def test_meters_to_tile_3(self): gmp = GlobalMercatorProfile() point = MetersPoint(7682838.58, 4106808.65) try: gmp.to_tile(point) assert False except KeyError as e: assert e is not None and type(e) == KeyError
def test_lon_lat_to_tile_1(self): gmp = GlobalMercatorProfile() point = LonLatPoint(-34.123, 78.1234) try: gmp.to_tile(point) assert False except NotImplementedError as e: assert e is not None and type(e) == NotImplementedError
def test_meters_to_tile_2(self): gmp = GlobalMercatorProfile() point = MetersPoint(7682838.58, 4106808.65) result = gmp.to_tile(point, zoom=14) assert result.tx == 11332 and result.ty == 9870
def test_meters_to_tile_1(self): gmp = GlobalMercatorProfile() point = MetersPoint(-20037508.34, 20037508.34) result = gmp.to_tile(point, zoom=0) assert result.tx == 0 and result.ty == 0
def test_pixels_to_tile_2(self): gmp = GlobalMercatorProfile() point = PixelsPoint(256, 257) result = gmp.to_tile(point) assert result.tx == 0 and result.ty == 1
def test_tile_to_tile_1(self): gmp = GlobalMercatorProfile() tile = Tile(34, 100) result = gmp.to_tile(tile) assert result.tx == tile.tx and \ result.ty == tile.ty