Skip to content

Instantly share code, notes, and snippets.

@DanielKinsman
Last active October 20, 2016 01:21
Show Gist options
  • Save DanielKinsman/cb2efa2c534a7d0c29abc55a95be0579 to your computer and use it in GitHub Desktop.
Save DanielKinsman/cb2efa2c534a7d0c29abc55a95be0579 to your computer and use it in GitHub Desktop.
Fiona crash on windows
#!/usr/bin/env python
# requirements: ['fiona==1.7.0', 'gdal==2.0.3']
import gdal
import fiona
import fiona.crs
schema = {'geometry': 'Point', 'properties': {'a': 'str'}}
feature = {
'type': 'Feature',
'geometry': {'type': 'Point', 'coordinates': (0, 0)},
'id': '0',
'properties': {'a': 'a'}
}
# This works on windows
with fiona.open('test1.geojson', 'w', driver='GeoJSON', crs=fiona.crs.from_epsg(4326), schema=schema) as sink:
sink.write(feature)
# This *crashes* on windows
with fiona.drivers():
with fiona.open('test2.geojson', 'w', driver='GeoJSON', crs=fiona.crs.from_epsg(4326), schema=schema) as sink:
sink.write(feature)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment