Summary
hand.py computes Height Above Nearest Drainage using D8 flow tracing only. There's no D-inf variant.
What's needed
D-inf HAND traces downstream from each cell using the continuous angle from D-inf flow direction to find the nearest stream cell, then returns the elevation difference between the starting cell and that stream cell.
At each step, the angle decomposition identifies two neighbor cells with proportional weights. The trace should follow the dominant neighbor (higher weight) to find the drainage cell. Alternatively, both branches could be followed and the nearest stream cell (by path length or weighted distance) selected.
The dominant-neighbor approach keeps the output comparable to D8 HAND -- one scalar elevation difference per cell.
References
xrspatial/hand.py -- existing D8 implementation
xrspatial/flow_accumulation_dinf.py -- angle decomposition into two neighbors with proportional weights
Summary
hand.pycomputes Height Above Nearest Drainage using D8 flow tracing only. There's no D-inf variant.What's needed
D-inf HAND traces downstream from each cell using the continuous angle from D-inf flow direction to find the nearest stream cell, then returns the elevation difference between the starting cell and that stream cell.
At each step, the angle decomposition identifies two neighbor cells with proportional weights. The trace should follow the dominant neighbor (higher weight) to find the drainage cell. Alternatively, both branches could be followed and the nearest stream cell (by path length or weighted distance) selected.
The dominant-neighbor approach keeps the output comparable to D8 HAND -- one scalar elevation difference per cell.
References
xrspatial/hand.py-- existing D8 implementationxrspatial/flow_accumulation_dinf.py-- angle decomposition into two neighbors with proportional weights