[fix] OSM name keys, break out of loop early in categorizing OSM boundary components
This commit is contained in:
@@ -124,6 +124,7 @@ class AddressComponents(object):
|
|||||||
normalized_key = osm_address_components.get_component(country, k, v)
|
normalized_key = osm_address_components.get_component(country, k, v)
|
||||||
if normalized_key:
|
if normalized_key:
|
||||||
components[normalized_key].append(props)
|
components[normalized_key].append(props)
|
||||||
|
break
|
||||||
return components
|
return components
|
||||||
|
|
||||||
def address_language(self, components, candidate_languages):
|
def address_language(self, components, candidate_languages):
|
||||||
@@ -160,8 +161,10 @@ class AddressComponents(object):
|
|||||||
|
|
||||||
Pick a name key from OSM
|
Pick a name key from OSM
|
||||||
'''
|
'''
|
||||||
name_key = boundary_names.name_key(props, component)
|
raw_key = boundary_names.name_key(props, component)
|
||||||
return name_key, ''.join((name_key, suffix)) if ':' not in name_key else name_key
|
|
||||||
|
key = ''.join((raw_key, suffix)) if ':' not in raw_key else raw_key
|
||||||
|
return key, raw_key
|
||||||
|
|
||||||
def all_names(self, props, languages):
|
def all_names(self, props, languages):
|
||||||
names = set()
|
names = set()
|
||||||
|
|||||||
Reference in New Issue
Block a user