navigate_nldi: Navigate NLDI

View source: R/get_nldi.R

navigate_nldiR Documentation

Description

Navigate the Network Linked Data Index network.

Usage

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


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



nhdplusTools documentation built on June 22, 2024, 10:36 a.m.