Calculate stream order with GRASS

stream_order(lines, outlet, ...)

Arguments

lines

lines

outlet

outlet

...

options passed to rgrass7sf::initGRASS

Examples

if (FALSE) {
library(sf)
library(mapview)

data(nhd_sub_lines)

outlet <- st_sf(data.frame(1), geometry = st_cast(st_line_sample(
               dplyr::filter(nhd_sub_lines, comid == "7718290"),
           sample = 1), "POINT"))

res <- stream_order(lines = nhd_sub_lines, outlet = outlet)
# mapview(res, zcol = "strahler")
}