diff --git a/scripts/geodata/osm/components.py b/scripts/geodata/osm/components.py index 2993ef7f..7bf46832 100644 --- a/scripts/geodata/osm/components.py +++ b/scripts/geodata/osm/components.py @@ -66,4 +66,13 @@ class OSMAddressComponents(object): props = self.config.get(country, {}).get(prop, {}) return props.get(value, None) + def get_first_component(self, country, properties): + for k, v in six.iteritems(props): + containing_component = self.get_component(country, k, v) + break + else: + containing_component = None + return containing_component + + osm_address_components = OSMAddressComponents()