mamut_routing_tools.osm.audit¶
Coverage audit and POI backfill for OSM extracts already on disk.
An extract is a long-lived local asset: cities are fetched once and reused for months. When the acquisition side learns to fetch something it previously did not -- amenities mapped as ways and relations, which is a quarter to a third of the POIs in a real city -- nothing invalidates the files already downloaded, and generation quietly keeps drawing from the smaller pool.
This module answers "what do my extracts actually contain?" and refills the missing part in place, without re-downloading the road network.
audit_extract
¶
What one extract holds: element counts, POI counts per type, and bounds.
Counted in a single streaming pass without building POI objects, because a workspace can hold dozens of extracts of 100+ MB each.
Source code in MAMUT-routing-tools/src/mamut_routing_tools/osm/audit.py
audit_extracts
¶
Audit every *.osm in a directory, by city name.
Source code in MAMUT-routing-tools/src/mamut_routing_tools/osm/audit.py
refresh_extract_pois
¶
refresh_extract_pois(osm_path: str | Path, *, poi_categories: tuple[str, ...] | None = tuple(POI_CATEGORIES), progress: ProgressCallback | None = None, tile_cache_dir: str | Path | None = None, use_tile_cache: bool = True) -> dict[str, Any]
Backfill the amenities an extract is missing, in place.
Only the amenity query is re-run: the road network already in the file is left untouched, which is what makes this cheap enough to run over a whole workspace. The report pairs the audit before and after so a caller can say what each city gained.
Source code in MAMUT-routing-tools/src/mamut_routing_tools/osm/audit.py
refresh_extracts
¶
refresh_extracts(paths: list[Path], *, poi_categories: tuple[str, ...] | None = tuple(POI_CATEGORIES), on_city: Callable[[int, int, Path], None] | None = None, progress: ProgressCallback | None = None, tile_cache_dir: str | Path | None = None, use_tile_cache: bool = True) -> dict[str, Any]
Refresh several extracts, reporting each one rather than aborting.
One city failing -- a timeout, an Overpass outage -- must not cost the others: the run continues and the failure is reported on its own row.