Downstream flow path extraction is straightforward: the MATLAB version traverses the stream network and records the indices it encounters, building up the array dynamically. One could also do something like influencemap (using _stream.traverse_down_u32_or_and), followed by extracting the indices of highlighted pixels. The latter does more computation than the former, but does the traversal in libtopotoolbox.
Upstream flow path extraction requires more care because there may be more than one possible flow path. This is somewhat similar to what we do in StreamObject.trunk.
Downstream flow path extraction is straightforward: the MATLAB version traverses the stream network and records the indices it encounters, building up the array dynamically. One could also do something like
influencemap(using_stream.traverse_down_u32_or_and), followed by extracting the indices of highlighted pixels. The latter does more computation than the former, but does the traversal in libtopotoolbox.Upstream flow path extraction requires more care because there may be more than one possible flow path. This is somewhat similar to what we do in
StreamObject.trunk.