Description
Shapefile exporting code in FloPy relies primarily on pyshp to build and write shapefiles of model inputs and outputs. Recently (within the past year or so), we added geopandas support on the FloPy Grid
objects, through the geo_dataframe
property method. This property method builds a GeoDataFrame
of the modelgrid and allows users to easily add boundary condition and output data as attributes, and to project and re-project the data using different CRS representations.
My proposal here, is to refactor the shapefile exporting code to use geopandas instead of pyshp. The goal of this is to speed up exporting, reduce the amount of custom code that we support, and to provide flexibility for exporting additional geospatial file types such as geoparquet
and geojson
.
Alternatives to this method are to remove the shapefile exporting code and have the user manually add attributes to a GeoDataFrame
that they produce. While this is the process I've currently been using, maintaining/updating the exporting helper functions would reduce the amount of code the user has to write to export shapefiles and would maintain a consistent interface.