google_streetview#
This module defines GoogleStreetview class downloading Google street imagery.
Exceptions#
Google rejected a Street View request for a non-coverage reason. |
|
Google panorama metadata was unavailable or malformed. |
|
A Street View image could not be downloaded or decoded. |
|
Street View metadata exists, but no retrievable image is available. |
Classes#
A class that downloads street-level imagery and depth maps for buildings. |
Module Contents#
- exception openplaces.io.scrapers.google_streetview.GoogleStreetViewAPIError#
Bases:
RuntimeErrorGoogle rejected a Street View request for a non-coverage reason.
- exception openplaces.io.scrapers.google_streetview.GoogleStreetViewPanoramaMetadataError#
Bases:
RuntimeErrorGoogle panorama metadata was unavailable or malformed.
- exception openplaces.io.scrapers.google_streetview.GoogleStreetViewDownloadError#
Bases:
RuntimeErrorA Street View image could not be downloaded or decoded.
Bases:
RuntimeErrorStreet View metadata exists, but no retrievable image is available.
- class openplaces.io.scrapers.google_streetview.GoogleStreetview(input_data: dict[str, Any])#
A class that downloads street-level imagery and depth maps for buildings.
Interfaces with the Google Street View API to obtain high-resolution street-level images and corresponding depth maps based on specified building footprints.
- api_key#
API key for authenticating requests to the Google Street View API.
- get_images(inventory: openplaces.io.scrapers.types.AssetInventory, save_directory: str, entity_type: str = 'entity', download_year: int | None = None, redownload: bool = False) openplaces.io.scrapers.types.ImageSet#
Get street-level images of buildings from footprints in AssetInventory.
- Parameters:
inventory – AssetInventory for which the images will be retrieved.
save_directory – Path to the folder where the retrieved images will be saved.
entity_type – Type of entity being photographed (e.g. ‘footprint’, ‘parcel’). Used as a filename prefix.
download_year – Year the images are fetched; appended as a filename suffix.
redownload – Missing images are always fetched. When True, buildings whose image already exists on disk are re-fetched (overwritten) rather than reused.
- Returns:
An ImageSet for the assets in the inventory.
- Return type:
- Raises:
ValueError – If the provided inventory is not an instance of AssetInventory.