[osm] don't bother with the R-tree check if there are no name:* tags in border data set

This commit is contained in:
Al
2015-09-03 17:54:35 -04:00
parent 33af61095b
commit d54fb25e45

View File

@@ -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: