[osm] only add label props if the name property is identical (counterexample, Nottinghamshire's label is listed as West Bridgford, which is really its admin_center)

This commit is contained in:
Al
2016-10-16 22:18:52 -04:00
parent de9e234929
commit ff27ee14bb

View File

@@ -277,7 +277,7 @@ class OSMPolygonReader(object):
admin_centers.append(val)
elif role == 'label' and elem_type == 'node':
val = self.nodes.get(long(elem_id))
if val is not None:
if val is not None and val.get('name', six.u('')).lower() == props.get('name', six.u('')).lower():
props.update({k: v for k, v in six.iteritems(val)
if k not in props})