Skip to content

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

Open
@hohe12ly

Description

@hohe12ly

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions