Example #1
0
 def test_lon_lat_to_pixels_1(self):
     gmp = GlobalMercatorProfile()
     point = LonLatPoint(123.4567890, 98.7654321)
     try:
         gmp.to_pixels(point, zoom=18)
         assert False
     except NotImplementedError as e:
         assert e is not None and type(e) == NotImplementedError
Example #2
0
 def test_meters_to_pixels_4(self):
     gmp = GlobalMercatorProfile()
     point = MetersPoint(-20037508.342789244, -20037508.342789244)
     try:
         gmp.to_pixels(point, foo=12)
         assert False
     except KeyError as e:
         assert e is not None and type(e) == KeyError
Example #3
0
 def test_pixels_to_pixels_1(self):
     gmp = GlobalMercatorProfile()
     point = PixelsPoint(1, 2)
     result = gmp.to_pixels(point, zoom=12)
     assert point.x == result.x and point.y == result.y
Example #4
0
 def test_meters_to_pixels_2(self):
     gmp = GlobalMercatorProfile()
     point = MetersPoint(-20037508.342789244, -20037508.342789244)
     result = gmp.to_pixels(point, zoom=0)
     assert result.x == 0 and result.y == 0