From d460f0e202812be332b7ae36bf268e2922fd52d7 Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 21 Apr 2026 19:08:04 +0000 Subject: [PATCH] Fix type classifier: POI check takes precedence over street_address Businesses with housenumbers (e.g. M&W Markets at 130 US-30) were classified as street_address because the housenumber check fired before the osm_key check. Reorder so osm_key in amenity/shop/tourism/leisure/office is evaluated first, ensuring businesses get type=poi regardless of whether they have a street address. Also adds office to the POI key set. Co-Authored-By: Claude Opus 4.6 --- lib/geocode.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/geocode.py b/lib/geocode.py index 21a2403..bb9c97f 100644 --- a/lib/geocode.py +++ b/lib/geocode.py @@ -325,12 +325,12 @@ def _parse_photon_features(features, source): feat_type = props.get('type', '') has_hn = bool(props.get('housenumber')) - if has_hn or osm_value in ('house', 'residential'): + if osm_key in ('amenity', 'shop', 'tourism', 'leisure', 'office'): + rtype = 'poi' + elif has_hn or osm_value in ('house', 'residential'): rtype = 'street_address' elif feat_type in ('city', 'town', 'village', 'hamlet', 'county', 'state', 'country'): rtype = 'locality' - elif osm_key in ('amenity', 'shop', 'tourism', 'leisure'): - rtype = 'poi' else: rtype = 'poi'