[boundaries] Adding option to still check for global overrides but only if nothing else was found using admin_level, etc. Updating South Korea and adding this option to Luxembourg.
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
"6": "city_district"
|
"6": "city_district"
|
||||||
"7": "suburb"
|
"7": "suburb"
|
||||||
"8": "suburb"
|
"8": "suburb"
|
||||||
no_global_overrides: true
|
global_overrides_last: true
|
||||||
|
|
||||||
overrides:
|
overrides:
|
||||||
id:
|
id:
|
||||||
|
|||||||
@@ -14,6 +14,8 @@
|
|||||||
"407489":
|
"407489":
|
||||||
admin_level:
|
admin_level:
|
||||||
"9": "city_district"
|
"9": "city_district"
|
||||||
|
global_overrides_last: true
|
||||||
|
|
||||||
|
|
||||||
use_admin_center:
|
use_admin_center:
|
||||||
- id: 407489 # Luxembourg City
|
- id: 407489 # Luxembourg City
|
||||||
|
|||||||
@@ -139,8 +139,10 @@ class OSMAddressComponents(object):
|
|||||||
|
|
||||||
values = [(k.lower(), v.lower()) for k, v in six.iteritems(properties) if isinstance(v, six.string_types)]
|
values = [(k.lower(), v.lower()) for k, v in six.iteritems(properties) if isinstance(v, six.string_types)]
|
||||||
|
|
||||||
|
global_overrides_last = config.get('global_overrides_last', False)
|
||||||
|
|
||||||
# place=city, place=suburb, etc. override per-country boundaries
|
# place=city, place=suburb, etc. override per-country boundaries
|
||||||
if not config.get('no_global_overrides', False):
|
if not global_overrides_last:
|
||||||
for k, v in values:
|
for k, v in values:
|
||||||
containing_component = self.global_keys_override.get(k, {}).get(v, None)
|
containing_component = self.global_keys_override.get(k, {}).get(v, None)
|
||||||
|
|
||||||
@@ -162,6 +164,13 @@ class OSMAddressComponents(object):
|
|||||||
if containing_component is not None:
|
if containing_component is not None:
|
||||||
return containing_component
|
return containing_component
|
||||||
|
|
||||||
|
if global_overrides_last:
|
||||||
|
for k, v in values:
|
||||||
|
containing_component = self.global_keys_override.get(k, {}).get(v, None)
|
||||||
|
|
||||||
|
if containing_component is not None:
|
||||||
|
return containing_component
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
osm_address_components = OSMAddressComponents()
|
osm_address_components = OSMAddressComponents()
|
||||||
|
|||||||
Reference in New Issue
Block a user