Example #1
0
def test_get_assets_from_json():
    """Get assets list."""
    qkz = mosaic_content.get("quadkey_zoom") or mosaic_content.get("minzoom")
    assert (len(
        utils.get_assets_from_json(mosaic_content["tiles"], qkz, 150, 182,
                                   9)) == 2)
    assert (len(
        utils.get_assets_from_json(mosaic_content["tiles"], qkz, 147, 182,
                                   9)) == 1)
    assert (len(
        utils.get_assets_from_json(mosaic_content["tiles"], qkz, 147, 182,
                                   12)) == 0)
Example #2
0
 def point(self, lng: float, lat: float) -> List[str]:
     """Retrieve assets for point."""
     tile = mercantile.tile(lng, lat, self.quadkey_zoom)
     return get_assets_from_json(
         self.mosaic_def.tiles, self.quadkey_zoom, tile.x, tile.y, tile.z
     )
Example #3
0
 def tile(self, x: int, y: int, z: int) -> List[str]:
     """Retrieve assets for tile."""
     return get_assets_from_json(self.mosaic_def.tiles, self.quadkey_zoom, x, y, z)