DOI-USGS / hydroloom

hydrologic geospatial fabric creation tools. See official repository here: https://code.usgs.gov/water/hydroloom
https://doi-usgs.github.io/hydroloom/
Creative Commons Zero v1.0 Universal
25 stars 2 forks source link

Cast waterbodies to single-part before assigning Index ID #34

Closed abock80 closed 4 months ago

abock80 commented 4 months ago

While working with some of the point interbasin transfers and trying to index to waterbodies/flowlines, noticed flowlines are correct, but waterbodies are not. We believe the error is due to waterbodies being coerced to singlepart after the feature index identifiers are derived. Moving the "to_singlepart" function ahead of the feature index attribution fixed this error.

https://github.com/DOI-USGS/hydroloom/pull/33

dblodgett-usgs commented 4 months ago

Thanks for this -- I want to make sure this doesn't have any weird side affects. Will pull it down and double check a few things.

dblodgett-usgs commented 4 months ago

@abock80 do you have a waterbody polygon that is actually a multipolygon that I could use for testing? My test data is all single polygons.

abock80 commented 4 months ago

@dblodgett-usgs - yea I'll try to dig one up. Long story short (explain this PM), Laura had been using the old "incorrect" reference_waterbody set, but I think it's an error that may (?) come up.

dblodgett-usgs commented 4 months ago

hmmm... ok. Maybe the function should check if waterbodies are true multipart polygons and just error if they are? The function is not designed to support multipolygons and I'm concerned that it would be a lot of complexity to get it right for a very edge case situation.

abock80 commented 4 months ago

I'd be down with kicking out the error and having the user figure it out