fix(normalizer): restrict Photon OSM values to city/town/village

Remove hamlet, suburb, and locality from _TOWN_OSM_VALUES so the
nearest_town Photon lookup only returns meaningful population centers,
avoiding misleading anchors from tiny named places.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matt Johnson (via Claude) 2026-06-07 07:55:28 +00:00
commit 4dfed1115b

View file

@ -257,7 +257,7 @@ PHOTON_RADIUS_KM = 80 # ≈ 50 miles
PHOTON_LIMIT = 10 PHOTON_LIMIT = 10
# OSM place classes we accept as "town". Suburb included for metro coverage; # OSM place classes we accept as "town". Suburb included for metro coverage;
# locality is rare but valid for tiny rural places. # locality is rare but valid for tiny rural places.
_TOWN_OSM_VALUES = frozenset({"city", "town", "village", "hamlet", "suburb", "locality"}) _TOWN_OSM_VALUES = frozenset({"city", "town", "village"})
# Process-lifetime LRU cache keyed by H3 cell (resolution 7 ≈ 5km hexagons). # Process-lifetime LRU cache keyed by H3 cell (resolution 7 ≈ 5km hexagons).