Pull through additional OSM and Overture metadata fields.#30
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pulls through richer per-POI metadata from both OSM and Overture into the conflated snapshot, plus one minor bug fix related to brand in the conflated dataset.
File changes
Overture extraction (
src/openpois/io/overture.py)addresses[1].{freeform, locality, region, postcode, country},websites,phones,socials, andcategories.alternate, with the same column names propagated through_finalize_snapshot_in_duckdb.OSM extraction (
config.yaml)accesstodownload.osm.extract_keysso it survives into the snapshot.Merge (
src/openpois/conflation/merge.py)_present,_blend_with_backfill,_col_or_null,_unwrap_first_elementconsolidate the column-guard / blend / list-unwrap logic that was previously inline."") are treated as missing — Overture sometimes emits them.addr_street,addr_city,addr_state,addr_postcode,addr_country,phone,website.addr_housenumber,addr_unit,opening_hours,access.overture_socials,overture_categories_alternate.osm_addr_*,overture_addr_*,osm_phone,overture_phones,osm_website,overture_websites._build_unmatched_osm_gdfand_build_unmatched_overture_gdfpopulate the same schema with appropriate nulls so the three sub-frames concat cleanly.Conflation driver (
scripts/conflation/conflate.py)OSM_MERGE_COLS/OVERTURE_MERGE_COLSso they survive the per-shared-label row slice.Tests (
tests/test_merge.py)TestMetadataPullThroughclass (9 tests) covers: matched-row blending, OSM-only fields, unmatched-side traceability,LIST<STRING>unwrap (including empty list →None),accessflow, and two regressions — brand backfill when OSM is higher-confidence but null, and empty-string-as-missing.Bug fix:
Before this PR, when OSM had higher confidence than Overture but a null
brand, the matched row'sbrandwas dropped instead of falling back to Overture._blend_with_backfillmakes that backfill symmetric and is now used forname,brand, everyaddr_*,phone, andwebsite.