コード例 #1
0
    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)
コード例 #2
0
 def test_bounds(self):
     tile = geocontext.XYZTile(1, 1, 2)
     assert tile.bounds == (
         -10018754.171394622,
         -7.081154551613622e-10,
         0.0,
         10018754.171394626,
     )
コード例 #3
0
 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,
     }
コード例 #4
0
 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),
     }
コード例 #5
0
 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),
         })
コード例 #6
0
 def test_children_parent(self):
     tile = geocontext.XYZTile(1, 1, 2)
     assert tile == tile.children()[0].parent()
コード例 #7
0
 def test_geometry(self):
     tile = geocontext.XYZTile(1, 1, 2)
     assert tile.geometry.bounds == (-90.0, 0.0, 0.0, 66.51326044311186)
コード例 #8
0
 def test_bounds(self):
     tile = geocontext.XYZTile(1, 1, 2)
     assert tile.bounds == (-10018754.171394622, 0.0, 0.0, 10018754.171394622)
コード例 #9
0
 def test_children_parent(self):
     tile = geocontext.XYZTile(1, 1, 2)
     self.assertEqual(tile, tile.children()[0].parent())
コード例 #10
0
 def test_geometry(self):
     tile = geocontext.XYZTile(1, 1, 2)
     self.assertEqual(tile.geometry.bounds,
                      (-90.0, 0.0, 0.0, 66.51326044311186))
コード例 #11
0
 def test_bounds(self):
     tile = geocontext.XYZTile(1, 1, 2)
     self.assertEqual(tile.bounds,
                      (-10018754.171394622, -7.081154551613622e-10, 0.0,
                       10018754.171394626))