pycitydata.sateimg.sateimg

Module Contents

Functions

_download_one_tile

Download the tile for the given x and y coordinates. From Esri living atlas, the token is required to download the tiles.

download_all_tiles

Download all the tiles for the given x and y coordinates. From Esri living atlas, the token is required to download the tiles.

_concat_img_one_region

Concatenate the tiles to obtain the regional satellite images.

_concatenate_tiles

Concatenate the tiles to obtain all the regional satellite images given the area.

download_sateimgs

Download the satellite images for the given area from Esri living atlas.

Data

API

pycitydata.sateimg.sateimg.__all__

[‘download_sateimgs’, ‘download_all_tiles’]

pycitydata.sateimg.sateimg._download_one_tile(args)

Download the tile for the given x and y coordinates. From Esri living atlas, the token is required to download the tiles.

Depending on the API of the tile server.

pycitydata.sateimg.sateimg.download_all_tiles(base_url: str, Z: int, Y_X: List[str]) Tuple[Dict[str, PIL.Image.Image], List[str]]

Download all the tiles for the given x and y coordinates. From Esri living atlas, the token is required to download the tiles.

The tiles are downloaded into the given directory.

Args:

  • base_url (str): the base url of the tile server.

  • Z (int): the zoom level.

  • Y_X (List[str]): the list of y_x coordinates.

Returns:

  • cached_tiles (Dict[str, Image.Image]): the cached tiles.

  • fail_tile_list (List[str]): the list of failed tiles.

pycitydata.sateimg.sateimg._concat_img_one_region(args)

Concatenate the tiles to obtain the regional satellite images.

pycitydata.sateimg.sateimg._concatenate_tiles(region_list, area_shp: geopandas.GeoDataFrame, cached_tiles: Dict[str, PIL.Image.Image])

Concatenate the tiles to obtain all the regional satellite images given the area.

pycitydata.sateimg.sateimg.download_sateimgs(area_shp: geopandas.GeoDataFrame, base_url: str = 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/default028mm/MapServer/tile/41468', Z: int = 15) Dict[int, PIL.Image.Image]

Download the satellite images for the given area from Esri living atlas.

Args:

  • area_shp (gpd.GeoDataFrame): the areas to download the satellite images.

Returns:

  • regional_imgs (Dict[int, Image.Image]): the regional satellite images.