Skip to content

Instantly share code, notes, and snippets.

@dandye
Created March 27, 2012 00:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dandye/2210901 to your computer and use it in GitHub Desktop.
Save dandye/2210901 to your computer and use it in GitHub Desktop.
Bare Bones Fiona Polygon
SCHEMA = {'geometry': 'Polygon', 'properties': {'name': 'str','token': 'str'}}
FEATURE = {'id': '1',
'geometry':
{'type': 'Polygon',
'coordinates': [[(-1.0, -1.0),
(-1.0, 1.0),
(1.0, 1.0),
(1.0, -1.0),
(-1.0, -1.0)]]
},
'properties': {'name': '',
'token':''}
}
with collection("a_shp_by_fiona.shp", "w", "ESRI Shapefile", SCHEMA) as c:
for i in range(1,6):
f = FEATURE.copy()
f['id'] = str(i)
c.write(f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment