[fix] include admin center id and type

This commit is contained in:
Al
2016-07-15 16:39:17 -04:00
parent 65b4755487
commit 54fc7b47de
2 changed files with 2 additions and 1 deletions

View File

@@ -267,6 +267,7 @@ class OSMPolygonReader(object):
elif role == 'admin_centre' and elem_type == 'node':
val = self.nodes.get(long(elem_id))
if val is not None:
val['type'] = 'node'
val['id'] = long(elem_id)
admin_centers.append(val)

View File

@@ -337,7 +337,7 @@ class OSMReverseGeocoder(RTreePolygonIndex):
if admin_center:
props['admin_center'] = {k: v for k, v in six.iteritems(admin_center)
if k in cls.include_property_patterns or (six.u(':') in k and
if k in ('id', 'type') or k in cls.include_property_patterns or (six.u(':') in k and
six.u('{}:*').format(k.split(six.u(':'), 1)[0]) in cls.include_property_patterns)}
if inner_polys and not outer_polys: