build_bus_regions: fix 'cannot insert name, already exists' in geopandas 0.7.0 (#145)
* build_bus_regions: fix 'cannot insert name, already exists' * environment: allow geopandas 0.7.0 * build_bus_regions: ignore index when concatenating
This commit is contained in:
parent
c87a88967c
commit
7688d9ea27
@ -41,7 +41,7 @@ dependencies:
|
||||
- fiona
|
||||
- proj
|
||||
- pyshp
|
||||
- geopandas<=0.6.3
|
||||
- geopandas
|
||||
- rasterio
|
||||
- shapely
|
||||
- libgdal
|
||||
|
@ -88,7 +88,7 @@ if __name__ == "__main__":
|
||||
'y': offshore_locs['y'],
|
||||
'geometry': voronoi_partition_pts(offshore_locs.values, offshore_shape),
|
||||
'country': country
|
||||
}, index=offshore_locs.index)
|
||||
})
|
||||
offshore_regions_c = offshore_regions_c.loc[offshore_regions_c.area > 1e-2]
|
||||
offshore_regions.append(offshore_regions_c)
|
||||
|
||||
@ -98,6 +98,6 @@ if __name__ == "__main__":
|
||||
schema = {**gpd.io.file.infer_schema(s), 'geometry': 'Unknown'}
|
||||
s.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, ignore_index=True), snakemake.output.regions_onshore)
|
||||
|
||||
save_to_geojson(pd.concat(offshore_regions), snakemake.output.regions_offshore)
|
||||
save_to_geojson(pd.concat(offshore_regions, ignore_index=True), snakemake.output.regions_offshore)
|
||||
|
Loading…
Reference in New Issue
Block a user