[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.

This commit is contained in:
Al
2017-01-16 19:10:27 -05:00
parent 96a98fc63c
commit 35dbce59d2

View File

@@ -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']