image_ingester#

Image ingestion from Google Street View and Google Satellite for building footprints.

Called by Ingester._ingest_download_partition when recipe['image_scraper'] is set. Images are saved to the external data directory; a metadata parquet (entity_id → image_path + camera fields) is written alongside them.

Functions#

fetch_images_by_admin(→ None)

Fetch Google images per building and write metadata parquets per admin unit.

Module Contents#

openplaces.io.image_ingester.fetch_images_by_admin(ingester, n_sample: int | None = None, target_recipe_id: str | None = None) None#

Fetch Google images per building and write metadata parquets per admin unit.

Called by Ingester._ingest_download_partition when recipe['image_scraper'] is set. For each admin unit in ingester.admin_ids_to_process:

  1. Load buildings from target_recipe_id (falls back to recipe['entity_recipe']).

  2. Convert to AssetInventory.

  3. Run the appropriate scraper (google_streetview or google_satellite).

  4. Save images to the external directory under {admin_path}/{entity_path}/images/.

  5. Write a metadata parquet (entity_id, image_path, camera fields) to the standard external path.

Parameters:
  • ingesteropenplaces.io.ingester.Ingester instance with resolved admin_ids_to_process and recipe.

  • n_sample – If set, cap the number of buildings processed per admin unit. Useful for test runs.

  • target_recipe_id – Recipe ID of the harmonized entity to photograph (e.g. 'US_building-nsi-2022' for NSI point buildings, 'US_footprint-cheer-2026' for polygon footprints). When None, falls back to recipe['entity_recipe'].