NOAA-OWP / inundation-mapping

Flood inundation mapping and evaluation software configured to work with U.S. National Water Model.
Other
95 stars 30 forks source link

[8pt] Stage-based CatFIM creating weird boxes in gpkgs #1309

Open EmilyDeardorff opened 1 month ago

EmilyDeardorff commented 1 month ago

Stage-based CatFIM has recently started creating geopackages with weird box-y shapes alongside the inundation polygons.

Current behavior

The stage-based CatFIM output geopackage has the expected inundation polygons with large rectangular box shapes included.

Expected behavior

We would expect to see the smaller inundation polygon without the large rectangular box.

Screenshots

Weird boxes: image

EmilyDeardorff commented 1 month ago

Notes

Debugging Progress (as of 10/7/24)

Folder setup

Docker image

Fiona and Pyogrio

NoData Values

this nodata stuff seems to be new…? from this commit

image

here, nodata is set to -1

whereas here(for stage-based), in dev, nodata is set to 10? image

test with stage-based nodata val set to 10 image

it looks like the boxes are still formed with that code variation → image

RobHanna-NOAA commented 1 month ago

While unlikely... after Emily tries more of her code level tests, we could try taking a current docker container and manually rolling back some of the packages to see if that helps.

Also.. Emily is likely already on this, but in produce_tif_per_huc_per_mag_for_stage, we are really using a rather non-conventional to do it. Maybe we can look at some similar changes for making in things like agreedem.py. with rasterio.open(dem) as elev, rasterio.open(rivers_raster) as rivers: Might be worth just dumping this idea in and trying it. Obviously we don't need most of that code in agreedem.py but it does do dem masking a bit different and might give some clues (or even a fix).

RobHanna-NOAA commented 1 month ago

Another idea to chase later is maybe how it mosiacs?