Exemplo n.º 1
0
 def test_transform_coord_map_to_image_offset(self):
     coord = (-1850865 + 2, 2956785 - 2)
     point = geom.transform_coord(coord,
                                  self.xform_matrix,
                                  src="map",
                                  dst="image")
     self.assertEqual(point, (0, 0))
Exemplo n.º 2
0
 def test_transform_coord_map_to_image_lower_right(self):
     coord = (-1850865 + (30 * 255), 2956785 + ((-30) * 255))
     point = geom.transform_coord(coord,
                                  self.xform_matrix,
                                  src="map",
                                  dst="image")
     self.assertEqual(point, (255, 255))
Exemplo n.º 3
0
 def __getitem__(self, proj_point):
     """Get value for given projection point"""
     # XXX why isn't this next line using the self._point_transformer matrix
     #     that's areadly been created?
     tm = geom.get_transform_matrix(self, self._spec)  # blech
     (x, y) = proj_point
     (tx, ty) = geom.transform_coord(proj_point, tm, src="map", dst="image")
     return self._data[tx, ty]
Exemplo n.º 4
0
 def test_transform_coord_map_to_image_offset(self):
     coord  = (-1850865+2, 2956785-2)
     point = geom.transform_coord(
             coord, self.xform_matrix, src="map", dst="image")
     self.assertEqual(point, (0,0))
Exemplo n.º 5
0
 def test_transform_coord_map_to_image_lower_right(self):
     coord = (-1850865+(30*255), 2956785+((-30)*255))
     point = geom.transform_coord(
             coord, self.xform_matrix, src="map", dst="image")
     self.assertEqual(point, (255,255))