mirror of
https://github.com/zvx-echo6/recon.git
synced 2026-05-20 06:34:40 +02:00
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 <noreply@anthropic.com>
This commit is contained in:
parent
65693d15aa
commit
d460f0e202
1 changed files with 3 additions and 3 deletions
|
|
@ -325,12 +325,12 @@ def _parse_photon_features(features, source):
|
||||||
feat_type = props.get('type', '')
|
feat_type = props.get('type', '')
|
||||||
has_hn = bool(props.get('housenumber'))
|
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'
|
rtype = 'street_address'
|
||||||
elif feat_type in ('city', 'town', 'village', 'hamlet', 'county', 'state', 'country'):
|
elif feat_type in ('city', 'town', 'village', 'hamlet', 'county', 'state', 'country'):
|
||||||
rtype = 'locality'
|
rtype = 'locality'
|
||||||
elif osm_key in ('amenity', 'shop', 'tourism', 'leisure'):
|
|
||||||
rtype = 'poi'
|
|
||||||
else:
|
else:
|
||||||
rtype = 'poi'
|
rtype = 'poi'
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue