Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

split_flows.py: tiny split reaches caused by mismatch of flowline and lake polygon #544

Open
hohe12ly opened this issue Feb 27, 2022 · 0 comments · May be fixed by #545
Open

split_flows.py: tiny split reaches caused by mismatch of flowline and lake polygon #544

hohe12ly opened this issue Feb 27, 2022 · 0 comments · May be fixed by #545

Comments

@hohe12ly
Copy link

DEM-derived flowlines may not align perfectly within a lake polygon, leading to tiny short split model reaches and corresponding catchments that look weird and may be hydrologically difficult to handle. A new algorithm is developed and will be submitted as a pull request.

Current behavior

DEM-derived flowlines are overlapped with WBD8 boundary first to split boundary flowlines into inside and outside portions. Similar overlapping is applied on lakes. This is done by a simply GeoPandas overlay operation with union method. In GeoPandas 0.9.0, this overlay gives out warning on dropped splits outside of lake polygons, but harmless.

However, the following case on HUC8 12090205 (Tx Austin) shows such handling creates unexpected splits, illustrated below. Since the DEM-derived flowline does not fall entirely into the lake polygon, instead, it goes in and out of the lake several times, creating tiny splits as short as 0.17m.

image

image

Expected behavior

The designer of this code can confirm, I think the intended flow splitting logic is to split a flowline that overlaps a lake into at most three parts: the one leads to the inlet of the lake, the one within the lake boundary, and the one coming out of the outlet. Given this assumption, I coded a new algorithm to split the flows when they overlap with lakes. The code handles the general case of multiple flowlines overlapping multiple lake polygons as long as no two lake polygons overlap.

The flow splitting after the fix:

image

Also, in the fix, another minor bug is fixed. Overlapping flowlines with HUC8 boundaries may also create empty geometries (HUC8 12100202). So empty geometries need to be removed after HUC8 overlapping, too.

Steps to replicate behavior (include URLs)

The issue was discovered when I was producing HAND on 3m DEM for Texas.

hohe12ly pushed a commit to hohe12ly/inundation-mapping that referenced this issue Feb 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant