Skip to content

Add D8 flow routing using new libtopotoolbox interface#432

Merged
wkearn merged 1 commit into
TopoToolbox:mainfrom
wkearn:new-d8
May 12, 2026
Merged

Add D8 flow routing using new libtopotoolbox interface#432
wkearn merged 1 commit into
TopoToolbox:mainfrom
wkearn:new-d8

Conversation

@wkearn
Copy link
Copy Markdown
Member

@wkearn wkearn commented May 11, 2026

Resolves #421

This commit allows users to use the new libtopotoolbox functions for D8 routing with least cost auxiliary topography carving by passing method="d8" and sink_resolution="lcat" to the FlowObject constructor.

The default argument for "sink_resolution" is "carve", which applies the previous behavior. Nothing will change for users at the moment without explicit changes to user code. Eventually, we will probably deprecate the old behavior.

The new version (FlowObject(method="d8", sink_resolution="lcat")) will NOT produce identical results to (FlowObject(method="d8", sink_resolution="carve")) because of differences in the underlying libtopotoolbox implementation.

All of the FlowObject tests have been modified to also run with "d8" and "lcat", and they should pass.

The various flow routing functions are implemented as private functions of the flow_object module. Users should not call these functions but use the FlowObject constructor. It is highly likely that the implementation will need to change as we add different flow routing algorithms (Dinf, MFD, etc.), but the FlowObject constructor will always be the user-facing interface to flow routing.

Resolves TopoToolbox#421

This commit allows users to use the new libtopotoolbox functions for
D8 routing with least cost auxiliary topography carving by passing
`method="d8"` and `sink_resolution="lcat"` to the FlowObject
constructor.

The default argument for "sink_resolution" is "carve", which applies
the previous behavior.

The new version (`FlowObject(method="d8", sink_resolution="lcat")`)
will NOT produce identical results to (`FlowObject(method="d8",
sink_resolution="carve")`) because of differences in the underlying
libtopotoolbox implementation.

All of the FlowObject tests have been modified to also run with "d8"
and "lcat", and they should pass.

The various flow routing functions are implemented as private
functions of the flow_object module. Users should not call these
functions but use the `FlowObject` constructor. It is highly likely
that the implementation will need to change as we add different flow
routing algorithms (Dinf, MFD, etc.), but the FlowObject constructor
will always be the user-facing interface to flow routing.

Signed-off-by: William Kearney <william.kearney@uni-potsdam.de>
@wkearn wkearn merged commit 1d109b6 into TopoToolbox:main May 12, 2026
17 checks passed
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 this pull request may close these issues.

Use new modular flow routing interface for D8

1 participant