From 420ceb6c38934c87971524ae68108ae15cca2dc4 Mon Sep 17 00:00:00 2001 From: Al Date: Mon, 30 May 2016 23:10:04 -0400 Subject: [PATCH] [intersections] Only requiring a tag to share at least two ways --- scripts/geodata/osm/formatter.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/geodata/osm/formatter.py b/scripts/geodata/osm/formatter.py index 1459171a..0ab0a22f 100644 --- a/scripts/geodata/osm/formatter.py +++ b/scripts/geodata/osm/formatter.py @@ -599,8 +599,10 @@ class OSMAddressFormatter(object): base_name_tag = base_name_tags[0] for tag in tags: - if tag.rsplit(':', 1)[0] in all_name_tags and all((tag in w for w in ways)): - way_names = [(w[tag], w.get(base_name_tag) if base_name_tag else None) for w in ways] + if tag.rsplit(':', 1)[0] in all_name_tags: + way_names = [(w[tag], w.get(base_name_tag) if base_name_tag else None) for w in ways if tag in w] + if len(way_names) < 2: + continue if ':' in tag: namespaced_language = tag.rsplit(':')[-1]