Navigate the Network Linked Data Index network.

navigate_nldi(
  nldi_feature,
  mode = "upstreamMain",
  data_source = "flowlines",
  distance_km = 10
)

Arguments

nldi_feature

list with names `featureSource` and `featureID` where `featureSource` is derived from the "source" column of the response of get_nldi_sources and the `featureID` is a known identifier from the specified `featureSource`.

mode

character chosen from ("UM", "UT", DM", "DD"). See examples.

data_source

character chosen from "source" column of the response of get_nldi_sources or empty string for flowline geometry.

distance_km

numeric distance in km to stop navigating.

Value

sf data.frame with result

Examples

# \donttest{
library(sf)
library(dplyr)

nldi_nwis <- list(featureSource = "nwissite", featureID = "USGS-05428500")

navigate_nldi(nldi_feature = nldi_nwis,
              mode = "upstreamTributaries")$UT %>%
  st_geometry() %>%
  plot()

navigate_nldi(nldi_feature = nldi_nwis,
              mode = "UM")$UM %>%
  st_geometry() %>%
  plot(col = "blue", add = TRUE)



nwissite <- navigate_nldi(nldi_feature = nldi_nwis,
                          mode = "UT",
                          data_source = "nwissite")$UT_nwissite

st_geometry(nwissite) %>%
  plot(col = "green", add = TRUE)


nwissite
#> Simple feature collection with 4 features and 9 fields
#> Geometry type: POINT
#> Dimension:     XY
#> Bounding box:  xmin: -89.45556 ymin: 43.08944 xmax: -89.36083 ymax: 43.13
#> Geodetic CRS:  WGS 84
#> # A tibble: 4 × 10
#>   sourceName      identifier  comid name  reachcode measure mainstem     X     Y
#>   <chr>           <chr>       <int> <chr> <chr>       <dbl> <chr>    <dbl> <dbl>
#> 1 NWIS Surface W… USGS-0542… 1.33e7 LAKE… 07090002…     0   https:/… -89.4  43.1
#> 2 NWIS Surface W… USGS-0542… 1.33e7 YAHA… 07090002…    42.0 https:/… -89.4  43.1
#> 3 NWIS Surface W… USGS-4306… 1.33e7 LAKE… 07090002…    59.3 https:/… -89.5  43.1
#> 4 NWIS Surface W… USGS-4307… 1.33e7 Warn… 07090002…   100   NA       -89.4  43.1
#> # ℹ 1 more variable: geometry <POINT [°]>
# }