From 35dbce59d233759afcec3585078912171c738945 Mon Sep 17 00:00:00 2001 From: Al Date: Mon, 16 Jan 2017 19:10:27 -0500 Subject: [PATCH] [osm] base case for default_language, applying the ways/relations requirement again as the nodes are mostly motorway_junction and can often be just a city name, etc. --- scripts/geodata/osm/formatter.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/geodata/osm/formatter.py b/scripts/geodata/osm/formatter.py index 4ff1e9c2..f8240a10 100644 --- a/scripts/geodata/osm/formatter.py +++ b/scripts/geodata/osm/formatter.py @@ -1381,6 +1381,8 @@ class OSMAddressFormatter(object): more_than_one_official_language = sum((1 for l, d in candidate_languages if d)) > 1 + default_language = None + if len(candidate_languages) == 1: default_language = candidate_languages[0][0] elif not more_than_one_official_language: @@ -1558,7 +1560,7 @@ class OSMAddressFormatter(object): all_name_tags = set(OSM_NAME_TAGS) all_base_name_tags = set(OSM_BASE_NAME_TAGS) - for key, value, deps in parse_osm(infile): + for key, value, deps in parse_osm(infile, allowed_types=WAYS_RELATIONS): latitude = value['lat'] longitude = value['lon']