Add D8 flow routing test#224
Merged
Merged
Conversation
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
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.