A domain is the root when its outlet nexus has no downstream
domain — the registry row for its outlet_nexus_id carries
to_domain_id = NA. The root is the basin's most-downstream domain.
Examples
g <- sf::read_sf(system.file("extdata/walker.gpkg", package = "hydroloom"))
h <- hy(g) |>
add_toids() |>
add_levelpaths(name_attribute = "GNIS_ID",
weight_attribute = "arbolate_sum")
d <- decompose_network(h)
is_root_domain(d, names(d$domains)[[1]])
#> [1] TRUE
