Disable stricter schema enforcement of GeoPandas

This commit is contained in:
Jonas Hoersch 2018-12-10 18:41:55 +01:00
parent 802261eedd
commit 5ed5974e86

View File

@ -41,7 +41,9 @@ for country in countries:
def save_to_geojson(s, fn): def save_to_geojson(s, fn):
if os.path.exists(fn): if os.path.exists(fn):
os.unlink(fn) os.unlink(fn)
s.reset_index().to_file(fn, driver='GeoJSON') df = s.reset_index()
schema = {**gpd.io.file.infer_schema(df), 'geometry': 'Unknown'}
df.to_file(fn, driver='GeoJSON', schema=schema)
save_to_geojson(pd.concat(onshore_regions), snakemake.output.regions_onshore) save_to_geojson(pd.concat(onshore_regions), snakemake.output.regions_onshore)