1
0
Fork 0

inspect available tag match groups for addresses

This commit is contained in:
Mateusz Konieczny 2025-01-30 18:33:30 +01:00
parent f3df3c73e6
commit be230357df

View file

@ -93,20 +93,38 @@ def nominatim_queries(tags, debug=False):
def nominatim_queries_transform_tags_into_queries(tags, debug=False):
address_tag_groups = [
# addr:city + identifier of a street location
['addr:country', 'addr:postcode', 'addr:city', 'addr:street', 'addr:housenumber'],
['addr:country', 'addr:postcode', 'addr:city', 'addr:street_address'],
# lets try without post code
['addr:country', 'addr:city', 'addr:street', 'addr:housenumber'],
['addr:country', 'addr:city', 'addr:street_address'],
# addr:place + identifier of a street location
['addr:country', 'addr:postcode', 'addr:place', 'addr:street', 'addr:housenumber'],
['addr:country', 'addr:postcode', 'addr:place', 'addr:street_address'],
# addr:place + house number (addr:housenumber may be unique to place, not to a specific street)
['addr:country', 'addr:postcode', 'addr:place', 'addr:housenumber'],
['addr:country', 'addr:place', 'addr:housenumber'],
['addr:country', 'addr:postcode', 'addr:city', 'addr:street_address'],
['addr:country', 'addr:city', 'addr:street_address'],
['addr:full'],
]
if tags.get('addr:country') in ['US'] and 'addr:state' in tags:
# prevent completely preventable mismatches
# TODO: why post codes are not used here?
address_tag_groups = [
# addr:city + identifier of a street location
['addr:country', 'addr:state', 'addr:city', 'addr:street', 'addr:housenumber'],
['addr:country', 'addr:state', 'addr:place', 'addr:housenumber'],
['addr:country', 'addr:state', 'addr:city', 'addr:street_address'],
# addr:place + identifier of a street location
['addr:country', 'addr:state', 'addr:place', 'addr:street', 'addr:housenumber'],
['addr:country', 'addr:state', 'addr:place', 'addr:street_address'],
# addr:place + house number (addr:housenumber may be unique to place, not to a specific street)
['addr:country', 'addr:state', 'addr:place', 'addr:housenumber'],
['addr:full'],
]
if 'addr:city' in tags and 'addr:street_address' in tags: