
Compute and add Strahler stream order to a directed acyclic network
Source:R/network_properties.R
get_streamorder.RdNative replacement for `hydroloom::add_streamorder` – same topological approach as [get_hydroseq()] (igraph topo-sort), with no external dependency and no non-dendritic/divergence handling required. Leaves are order 1; at each node the order is the max of its upstream contributors, incremented by 1 when that max is shared by two or more of them (Strahler).
Examples
# two headwaters (1,2) join at 3 -> outlet: 3 is order 2
get_streamorder(data.frame(flowpath_id = c("1", "2", "3"),
flowpath_toid = c("3", "3", "0")))
#> [1] 1 1 2