[addresses] only add city relacement if a city is not found first

This commit is contained in:
Al
2016-12-13 16:10:52 -05:00
parent 7e65661884
commit 40cd86c3be

View File

@@ -782,7 +782,9 @@ class AddressComponents(object):
have_sub_city = AddressFormatter.SUBURB in grouped_components or AddressFormatter.CITY_DISTRICT in grouped_components have_sub_city = AddressFormatter.SUBURB in grouped_components or AddressFormatter.CITY_DISTRICT in grouped_components
if (component == AddressFormatter.CITY or component in city_replacements) and component not in grouped_components and (not have_sub_city or not self.osm_component_is_village(props)): have_city = AddressFormatter.CITY in grouped_components
if (component == AddressFormatter.CITY or (component in city_replacements and not have_city)) and component not in grouped_components and (not have_sub_city or not self.osm_component_is_village(props)):
grouped_components[component].append(props) grouped_components[component].append(props)
def add_admin_boundaries(self, address_components, def add_admin_boundaries(self, address_components,