OSMTileLoader
srai.loaders.OSMTileLoader(
tile_server_url,
zoom,
verbose=False,
resource_type="png",
auth_token=None,
data_collector=None,
storage_path=None,
)
¶
srai.loaders.OSMTileLoader(
tile_server_url,
zoom,
verbose=False,
resource_type="png",
auth_token=None,
data_collector=None,
storage_path=None,
)
OSM Tile Loader.
Download raster tiles from user specified tile server, like listed in [1]. Loader finds x, y coordinates [2] for specified area and downloads tiles. Address is built with schema {tile_server_url}/{zoom}/{x}/{y}.{resource_type}
References
PARAMETER | DESCRIPTION |
---|---|
tile_server_url |
url of tile server, without z, x, y parameters
TYPE:
|
zoom |
zoom level [1]
TYPE:
|
verbose |
should print logs. Defaults to False.
TYPE:
|
resource_type |
file extension. Added to the end of url. Defaults to "png".
TYPE:
|
auth_token |
auth token. Added as access_token parameter to request. Defaults to None.
TYPE:
|
data_collector |
DataCollector object or
TYPE:
|
storage_path |
path to save data, used with SavingDataCollector. Defaults to None.
TYPE:
|
Source code in srai/loaders/osm_loaders/osm_tile_loader.py
¶
Return all tiles of region.
PARAMETER | DESCRIPTION |
---|---|
area |
Area for which to download objects.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
GeoDataFrame
|
gpd.GeoDataFrame: Pandas of tiles for each region in area transformed by DataCollector |
Source code in srai/loaders/osm_loaders/osm_tile_loader.py
¶
Download single tile from tile server. Return tile processed by DataCollector.
PARAMETER | DESCRIPTION |
---|---|
x(int) |
x tile coordinate
|
y(int) |
y tile coordinate
|
idx |
id of tile, if non created as x_y_self.zoom
TYPE:
|