Skip to content

Add D8 flow routing test#224

Merged
wkearn merged 1 commit into
TopoToolbox:mainfrom
wkearn:d8-test
Apr 27, 2026
Merged

Add D8 flow routing test#224
wkearn merged 1 commit into
TopoToolbox:mainfrom
wkearn:d8-test

Conversation

@wkearn
Copy link
Copy Markdown
Member

@wkearn wkearn commented Apr 27, 2026

See #223

This test is identical to the Dinf tests, but uses flow_routing_d8_carve. This overlaps somewhat with the tests in random_dem. It does not use the new flow routing interface at all, but this is the scaffold upon which I would like to test that new interface.

See TopoToolbox#223

This test is identical to the Dinf tests, but uses
flow_routing_d8_carve. This overlaps somewhat with the tests in
random_dem. It does not use the new flow routing interface at all, but
it is possible to add it.

Signed-off-by: William Kearney <william.kearney@uni-potsdam.de>
@wkearn wkearn merged commit fde0894 into TopoToolbox:main Apr 27, 2026
5 checks passed
wkearn added a commit that referenced this pull request May 6, 2026
Resolves #223

This adds the D8 flow routing functions

- `flow_routing_d8_directions`
- `flow_routing_d8_weights`

in src/d8.c that implement the new staged flow routing interface for
D8. This function does not resolve flow over flats. The old flat
resolution behavior of flow_routing_d8_carve has been migrated to
src/lcat.c (for "Least Cost Auxiliary Topography"). This includes the
two functions

- `resolve_flats_lcat`
- `resolve_flats_lcat_weights`

that use the auxiliary topography, which must still be computed
separately by `gwdt_computecosts` and `gwdt`.

The new implementations do NOT preserve the behavior of the previous
`flow_routing_d8_carve`. The order in which neighbors are checked has
been changed to be consistent with the dinf implementation and with
`flow_routing_tsort`. If the neighbor-checking order is changed to
that of `flow_routing_d8_carve`, the results are identical to the
previous ones.

The tests introduced by #224 have been modified to use the new
interface, and they should currently pass.

Signed-off-by: William Kearney <william.kearney@uni-potsdam.de>
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.

1 participant