[osm] removing place=district mapping globally (means city_district in Hungary) and mapping it specifically to state_district/city_district in the places where it's needed
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
"8": "city"
|
||||
"10": "city"
|
||||
|
||||
place:
|
||||
"district": "state_district"
|
||||
|
||||
overrides:
|
||||
id:
|
||||
|
||||
@@ -9,3 +9,9 @@
|
||||
"9": "city_district"
|
||||
"10": "suburb"
|
||||
|
||||
overrides:
|
||||
contained_by:
|
||||
relation:
|
||||
"1244004":
|
||||
place:
|
||||
"district": "city_district"
|
||||
@@ -8,6 +8,9 @@
|
||||
"8": "state_district"
|
||||
"10": "city"
|
||||
|
||||
place:
|
||||
"district": "state_district"
|
||||
|
||||
overrides:
|
||||
id:
|
||||
# Kuala Lumpur
|
||||
|
||||
@@ -5,3 +5,5 @@
|
||||
"7": "city"
|
||||
"9": "city_district"
|
||||
|
||||
place:
|
||||
"district": "city_district"
|
||||
@@ -6,6 +6,9 @@
|
||||
"8": "city_district"
|
||||
"10": "city"
|
||||
|
||||
place:
|
||||
"district": "state_district"
|
||||
|
||||
overrides:
|
||||
id:
|
||||
relation:
|
||||
|
||||
@@ -54,7 +54,6 @@ class OSMAddressComponents(object):
|
||||
'state': AddressFormatter.STATE,
|
||||
'region': AddressFormatter.STATE,
|
||||
'province': AddressFormatter.STATE,
|
||||
'district': AddressFormatter.STATE_DISTRICT,
|
||||
'county': AddressFormatter.STATE_DISTRICT,
|
||||
},
|
||||
'gnis:class': {
|
||||
@@ -112,7 +111,7 @@ class OSMAddressComponents(object):
|
||||
|
||||
return self.global_keys.get(prop, {}).get(value, None)
|
||||
|
||||
def component_from_properties(self, country, properties, containing=()):
|
||||
def component_from_properties(self, country, properties, containing=(), global_keys=True):
|
||||
country_config = self.config.get(country, {})
|
||||
|
||||
config = country_config
|
||||
@@ -157,7 +156,7 @@ class OSMAddressComponents(object):
|
||||
return containing_component
|
||||
|
||||
# other place keys like place=state, etc. serve as a backup
|
||||
# when no boundaries are available
|
||||
# when no admin_level tags are available
|
||||
for k, v in values:
|
||||
containing_component = self.global_keys.get(k, {}).get(v, None)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user