[fix] role in OSM polygon extraction

This commit is contained in:
Al
2015-10-21 16:35:25 -04:00
parent 336bfe32ca
commit 6f6d04966b

View File

@@ -51,7 +51,8 @@ def parse_osm(filename, allowed_types=ALL_OSM_TAGS, dependencies=False):
elif dependencies and item_type == 'way' and e.tag == 'nd':
deps.append(long(e.attrib['ref']))
elif dependencies and item_type == 'relation' and e.tag == 'member' and \
e.attrib.get('type') in ('way', 'relation'):
e.attrib.get('type') in ('way', 'relation') and \
e.attrib.get('role') in ('inner', 'outer'):
deps.append((long(e.attrib['ref']), e.attrib.get('role')))
key = elem_id if single_type else '{}:{}'.format(item_type, elem_id)