From d54fb25e45b3553e1e82d0dea120cd5a014c3bc1 Mon Sep 17 00:00:00 2001 From: Al Date: Thu, 3 Sep 2015 17:54:35 -0400 Subject: [PATCH] [osm] don't bother with the R-tree check if there are no name:* tags in border data set --- scripts/geodata/osm/osm_address_training_data.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/geodata/osm/osm_address_training_data.py b/scripts/geodata/osm/osm_address_training_data.py index 143dd9bf..a2f75d2d 100644 --- a/scripts/geodata/osm/osm_address_training_data.py +++ b/scripts/geodata/osm/osm_address_training_data.py @@ -581,6 +581,9 @@ def build_toponym_training_data(language_rtree, infile, out_dir): writer = csv.writer(f, 'tsv_no_quote') for key, value in parse_osm(infile): + if not sum((1 for k, v in value.iteritems() if k.startswith('name:'))) > 0: + continue + try: latitude, longitude = latlon_to_floats(value['lat'], value['lon']) except Exception: