mirror of
https://codeberg.org/matkoniecz/list_how_openstreetmap_can_be_improved_with_alltheplaces_data.git
synced 2025-05-13 05:03:09 +02:00
inspect available tag match groups for addresses
This commit is contained in:
parent
f3df3c73e6
commit
be230357df
1 changed files with 21 additions and 3 deletions
24
nominatim.py
24
nominatim.py
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue