Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Author: Claire Krause
- # Save the polygons to a shapefile
- schema = {'geometry': 'Polygon','properties': {'area': 'str'}}
- if os.path.isfile('test.shp'):
- with fiona.open('test.shp', "a", crs = from_epsg(3577), driver = 'ESRI Shapefile', schema = schema) as output:
- for ix, poly in MergedPolygonsGPD.iterrows():
- output.write(({'properties': {'area': poly['area']},'geometry': mapping(shape(poly['geometry']))}))
- else:
- with fiona.open('test.shp', "w", crs = from_epsg(3577), driver = 'ESRI Shapefile', schema = schema) as output:
- for ix, poly in MergedPolygonsGPD.iterrows():
- output.write(({'properties': {'area': poly['area']},'geometry': mapping(shape(poly['geometry']))}))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement