[osm/boundaries] check polygons with an ISO3166-2 as well in the country polygon index in case the country polygon is funky

This commit is contained in:
Al
2017-04-09 02:15:42 -04:00
parent 4ecd6c23c6
commit fc91471434
4 changed files with 23 additions and 3 deletions

View File

@@ -315,7 +315,7 @@ class OSMBuildingPolygonReader(OSMPolygonReader):
class OSMCountryPolygonReader(OSMPolygonReader):
def include_polygon(self, props):
return 'ISO3166-1:alpha2' in props or (props.get('type', 'relation'), safe_encode(props.get('id', ''))) in osm_admin1_ids
return 'ISO3166-1:alpha2' in props or 'ISO3166-2' in props or (props.get('type', 'relation'), safe_encode(props.get('id', ''))) in osm_admin1_ids
class OSMNeighborhoodPolygonReader(OSMPolygonReader):