watershed-workflow icon indicating copy to clipboard operation
watershed-workflow copied to clipboard

WW2.0: convert types to geodataframes

Open ecoon opened this issue 2 years ago • 0 comments

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 work will be to modernize WW to use a few common libraries:

  1. geopandas for all shapefile storage
  2. xarray for all raster storage
  3. pynhd and friends for data downloads
  4. possibly uxarray for exo mesh writing?

Currently this work is happening on branch ecoon/geopandas_xarray

  • [ ] Update environments with new package list @ecoon , @jgomezvelez
  • [ ] All file_managers that currently return fiona objects should be refactored to return GeoDataFrames. @jgomezvelez
  • [ ] Figure out how to get common attribute names across NHD variants @jgomezvelez , @ecoon
  • [x] All River objects will store a GeoDataFrame, and the node of the tree will refer to an index. @ecoon
  • [x] SplitHUC::polygons() will return a GeoDataFrame; properties of the HUC will be stored internally as a GeoDataFrame. @ecoon
  • [ ] Add file managers for pynhd, other hyriver packages @jgomezvelez
  • [x] Refactor and clean up all other utilities for working with the refactor of RiverTree and SplitHUCs @ecoon
  • [ ] Refactor and clean up hi-level API @ecoon
  • [ ] Library tests pass @ecoon
  • [ ] Refactor and test from jupyter notebooks @saubhagya-gatech
  • [ ] Make a decision around plotting
  • [ ] Release!

ecoon avatar Mar 11 '22 14:03 ecoon