Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. # Author: Claire Krause
  2.  
  3. # Save the polygons to a shapefile
  4. schema = {'geometry': 'Polygon','properties': {'area': 'str'}}
  5.  
  6. if os.path.isfile('test.shp'):
  7. with fiona.open('test.shp', "a", crs = from_epsg(3577), driver = 'ESRI Shapefile', schema = schema) as output:
  8. for ix, poly in MergedPolygonsGPD.iterrows():
  9. output.write(({'properties': {'area': poly['area']},'geometry': mapping(shape(poly['geometry']))}))
  10. else:
  11. with fiona.open('test.shp', "w", crs = from_epsg(3577), driver = 'ESRI Shapefile', schema = schema) as output:
  12. for ix, poly in MergedPolygonsGPD.iterrows():
  13. output.write(({'properties': {'area': poly['area']},'geometry': mapping(shape(poly['geometry']))}))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement