environmental-modeling-workflows / watershed-workflow

Python workflows for data-rich, hyper-resolution simulations of hydrologic models on watersheds.
Other
66 stars 29 forks source link

convert types to geodataframes #24

Open ecoon opened 2 years ago

ecoon commented 2 years ago

In v2, shapely is deprecating the ability to add attributes to a shape. This breaks a lot of things, because we store properties in a 'properties' dictionary as an attribute of the shape.

The better way to deal with this is geopandas and the GeoDataFrame, which is a pandas DataFrame that includes a "geometry" or other column that includes shapely objects.

The goal of this issue is to refactor the entire codebase to use GeoDataFrames instead of shapely objects with dictionaries.

  1. all file_managers that currently return fiona objects should now return GeoDataFrames.
  2. all fiona file reading can now happen using existing geopandas readers.
  3. CRS is now a property of the dataframe, and the CRS should get set there.
  4. All River objects will store a GeoDataFrame, and the node of the tree will refer to an index or the row itself? TBD
  5. SplitHUC::polygons() will return a GeoDataFrame; properties of the HUC will be stored internally as a GeoDataFrame.
  6. ???