plot_fun <- function(x, s, n) {
plot(sf::st_geometry(x), col = "grey")
plot(sf::st_geometry(x[x$id %in% n, ]), add = TRUE)
plot(sf::st_geometry(x[x$id %in% s, ]), col = "red", lwd = 3, add = TRUE)
}
x <- hy(sf::read_sf(system.file("extdata/new_hope.gpkg", package = "hydroloom")))
start <- 8891126
dm <- navigate_hydro_network(x, start, "DM")
plot_fun(x, start, dm)
dd <- navigate_hydro_network(x, start, "DD")
plot_fun(x, start, dd)
start <- 8894356
um <- navigate_hydro_network(x, start, "UM")
plot_fun(x, start, um)
ut <- navigate_hydro_network(x, start, "UT")
plot_fun(x, start, ut)
Run the code above in your browser using DataLab