[osm] country and postal code polygon readers

This commit is contained in:
Al
2016-10-01 01:11:35 -04:00
parent c77e36deab
commit 5d7405b2fd
3 changed files with 39 additions and 0 deletions

View File

@@ -308,3 +308,13 @@ class OSMSubdivisionPolygonReader(OSMPolygonReader):
class OSMBuildingPolygonReader(OSMPolygonReader):
def include_polygon(self, props):
return 'building' in props or 'building:part' in props or props.get('type', None) == 'building'
class OSMCountryPolygonReader(OSMPolygonReader):
def include_polygon(self, props):
return 'ISO3166-1:alpha2' in props
class OSMPostalCodesPolygonReader(OSMPolygonReader):
def include_polygon(self, props):
return props.get('boundary') == 'postal_code'