From b91be6ef7a3b5559dd3d50595a6f4c5262e2118c Mon Sep 17 00:00:00 2001 From: Al Date: Wed, 18 May 2016 21:23:26 -0400 Subject: [PATCH] [fix] OSM name keys, break out of loop early in categorizing OSM boundary components --- scripts/geodata/addresses/components.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/geodata/addresses/components.py b/scripts/geodata/addresses/components.py index d7d94c7d..bdac352b 100644 --- a/scripts/geodata/addresses/components.py +++ b/scripts/geodata/addresses/components.py @@ -124,6 +124,7 @@ class AddressComponents(object): normalized_key = osm_address_components.get_component(country, k, v) if normalized_key: components[normalized_key].append(props) + break return components def address_language(self, components, candidate_languages): @@ -160,8 +161,10 @@ class AddressComponents(object): Pick a name key from OSM ''' - name_key = boundary_names.name_key(props, component) - return name_key, ''.join((name_key, suffix)) if ':' not in name_key else name_key + raw_key = boundary_names.name_key(props, component) + + key = ''.join((raw_key, suffix)) if ':' not in raw_key else raw_key + return key, raw_key def all_names(self, props, languages): names = set()