Given a network and set of IDs, finds path lengths between all identified flowpath outlets. This algorithm finds distance between outlets regardless of flow direction.
get_path_lengths(outlets, network, cores = 1, status = FALSE)
data.frame containing the distance between pairs of network outlets. For a network with one terminal outlet, the data.frame will have `nrow(network)^2` rows.
source(system.file("extdata", "walker_data.R", package = "nhdplusTools"))
fline <- walker_flowline
outlets <- c(5329303, 5329357, 5329317, 5329365, 5329435, 5329817)
# Add toCOMID
fline <- nhdplusTools::get_tocomid(fline, add = TRUE)
fl <- dplyr::select(fline, ID = comid, toID = tocomid, lengthkm)
get_path_lengths(outlets, fl)
#> Warning: get_paths* is deprecated in favor of get_paths in the hydroloom package.
#> ID_1 ID_2 network_distance_km
#> 1 5329303 5329357 18.742
#> 2 5329303 5329317 5.797
#> 3 5329303 5329365 22.345
#> 4 5329303 5329435 35.130
#> 5 5329303 5329817 16.043
#> 6 5329357 5329317 12.945
#> 7 5329357 5329365 3.603
#> 8 5329357 5329435 16.388
#> 9 5329357 5329817 8.937
#> 10 5329317 5329365 16.548
#> 11 5329317 5329435 29.333
#> 12 5329317 5329817 10.246
#> 13 5329365 5329435 12.785
#> 14 5329365 5329817 12.540
#> 15 5329435 5329817 25.325