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 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 iningester.admin_ids_to_process:Load buildings from target_recipe_id (falls back to
recipe['entity_recipe']).Convert to AssetInventory.
Run the appropriate scraper (
google_streetvieworgoogle_satellite).Save images to the external directory under
{admin_path}/{entity_path}/images/.Write a metadata parquet (entity_id, image_path, camera fields) to the standard external path.
- Parameters:
ingester – openplaces.io.ingester.Ingester instance with resolved
admin_ids_to_processandrecipe.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). WhenNone, falls back torecipe['entity_recipe'].