This commit is contained in:
Jan Frederick 2020-03-19 17:56:33 +01:00
commit 664dd9ef8f
2 changed files with 4 additions and 4 deletions

View File

@ -41,7 +41,7 @@ dependencies:
- fiona - fiona
- proj - proj
- pyshp - pyshp
- geopandas<=0.6.3 - geopandas
- rasterio - rasterio
- shapely - shapely
- libgdal - libgdal

View File

@ -88,7 +88,7 @@ if __name__ == "__main__":
'y': offshore_locs['y'], 'y': offshore_locs['y'],
'geometry': voronoi_partition_pts(offshore_locs.values, offshore_shape), 'geometry': voronoi_partition_pts(offshore_locs.values, offshore_shape),
'country': country 'country': country
}, index=offshore_locs.index) })
offshore_regions_c = offshore_regions_c.loc[offshore_regions_c.area > 1e-2] offshore_regions_c = offshore_regions_c.loc[offshore_regions_c.area > 1e-2]
offshore_regions.append(offshore_regions_c) offshore_regions.append(offshore_regions_c)
@ -98,6 +98,6 @@ if __name__ == "__main__":
schema = {**gpd.io.file.infer_schema(s), 'geometry': 'Unknown'} schema = {**gpd.io.file.infer_schema(s), 'geometry': 'Unknown'}
s.to_file(fn, driver='GeoJSON', schema=schema) 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)