def test_resolution(self): tile = geocontext.XYZTile(1, 1, 0) assert tile.resolution == geocontext.EARTH_CIRCUMFERENCE_WGS84 / tile.tilesize # resolution at zoom 0 is just the Earth's circumfrence divided by tilesize assert geocontext.XYZTile( 1, 1, 2).resolution == (geocontext.XYZTile(1, 1, 3).resolution * 2) # resolution halves with each zoom level assert (geocontext.XYZTile(1, 1, 12).resolution == geocontext.XYZTile( 2048, 1024, 12).resolution)
def test_bounds(self): tile = geocontext.XYZTile(1, 1, 2) assert tile.bounds == ( -10018754.171394622, -7.081154551613622e-10, 0.0, 10018754.171394626, )
def test_raster_params(self): tile = geocontext.XYZTile(1, 1, 2) assert tile.raster_params == { "bounds": (-10018754.171394622, 0.0, 0.0, 10018754.171394622), "srs": "EPSG:3857", "bounds_srs": "EPSG:3857", "align_pixels": False, "resolution": 39135.75848201024, }
def test_raster_params(self): tile = geocontext.XYZTile(1, 1, 2) assert tile.raster_params == { "bounds": ( -10018754.171394622, -7.081154551613622e-10, 0.0, 10018754.171394626, ), "srs": "EPSG:3857", "bounds_srs": "EPSG:3857", "align_pixels": False, "dimensions": (256, 256), }
def test_raster_params(self): tile = geocontext.XYZTile(1, 1, 2) self.assertEqual( tile.raster_params, { 'bounds': (-10018754.171394622, -7.081154551613622e-10, 0.0, 10018754.171394626), 'srs': 'EPSG:3857', 'bounds_srs': 'EPSG:3857', 'align_pixels': False, 'dimensions': (256, 256), })
def test_children_parent(self): tile = geocontext.XYZTile(1, 1, 2) assert tile == tile.children()[0].parent()
def test_geometry(self): tile = geocontext.XYZTile(1, 1, 2) assert tile.geometry.bounds == (-90.0, 0.0, 0.0, 66.51326044311186)
def test_bounds(self): tile = geocontext.XYZTile(1, 1, 2) assert tile.bounds == (-10018754.171394622, 0.0, 0.0, 10018754.171394622)
def test_children_parent(self): tile = geocontext.XYZTile(1, 1, 2) self.assertEqual(tile, tile.children()[0].parent())
def test_geometry(self): tile = geocontext.XYZTile(1, 1, 2) self.assertEqual(tile.geometry.bounds, (-90.0, 0.0, 0.0, 66.51326044311186))
def test_bounds(self): tile = geocontext.XYZTile(1, 1, 2) self.assertEqual(tile.bounds, (-10018754.171394622, -7.081154551613622e-10, 0.0, 10018754.171394626))