* The NLDI service is now available through the `findNLDI` function.
* Adjusted Water Quality Portal (WPQ) URLs to follow new structure
* Fixed bug where some WQP results were being duplicated
* Added an argument to readWQPdata to ignore fetching site and parameter attributes.
...
...
@@ -54,7 +55,7 @@ dataRetrieval 2.5.0
dataRetrieval 2.4.0
==========
* Package readr now used for tab delimited parsing
* readr functions used to determine column types. Mostly, this produces the same results.
* readr functions used to determine column types. Mostly, this produces the same results.
* In the case where there is text in a numeric column (specified by the RDB header), these now remain characters (previously was converted to numeric)
* Columns that come back from web services as integers remain integers (previously was converted to numeric)
* Added reported time zone code information. dateTime columns by default get converted to UTC, but the original time zone code (tz_cd for instance) is appended to the data frame.
#' @title Retrieve features from the \href{https://labs.waterdata.usgs.gov/api/nldi/swagger-ui/index.html?configUrl=/api/nldi/v3/api-docs/swagger-config}{NLDI}
#' @description Provides a formal query to the \href{https://labs.waterdata.usgs.gov/about-nldi/index.html}{Network Linked Data Index}. The function is useful for topology and location based featrue discovery. A user must supply a starting feature, and can add optional navigation direction(s), and features to identify on the navigated networks. Valid starting options can be given by one of the following arguments: comid, nwis, huc12, wqp, location, and start.
#' @description Provides a formal query to the
#' \href{https://labs.waterdata.usgs.gov/about-nldi/index.html}{Network Linked Data Index}.
#' The function is useful for topology and location based feature discovery.
#' A user must supply a starting feature, and can add optional navigation direction(s),
#' and features to identify on the navigated network.
#' Valid starting options can be given by one of the following arguments: comid, nwis, huc12,
#' @param location Coordinate pair in WGS84 GCS provided as a numeric vector ordered lng/lat
#' @param origin a named list specifying a feature type and ID (e.g. list("comid" = 101))
#' @param nav where to navigate from the starting point ("UM", "UT", DM", "DD")
#' @param find what resources to find along the navigation path(s) (see nldi_offerings()$source). Can also include 'basin', which will return the upstream basin of the starting feature
#' @param distance_km how far to look along the navigation path in kilometers
#' @param find what resources to find along the navigation path(s) (see get_nldi_sources()$source). Can also include 'basin', which will return the upstream basin of the starting feature
#' @param distance_km how far to look along the navigation path in kilometers (default = 100)
#' @param no_sf if available, should `sf` be used for parsing, defaults to `TRUE` if `sf` is locally installed
\item{nav}{where to navigate from the starting point ("UM", "UT", DM", "DD")}
\item{find}{what resources to find along the navigation path(s) (see nldi_offerings()$source). Can also include 'basin', which will return the upstream basin of the starting feature}
\item{find}{what resources to find along the navigation path(s) (see get_nldi_sources()$source). Can also include 'basin', which will return the upstream basin of the starting feature}
\item{distance_km}{how far to look along the navigation path in kilometers}
\item{distance_km}{how far to look along the navigation path in kilometers (default = 100)}
\item{no_sf}{if available, should `sf` be used for parsing, defaults to `TRUE` if `sf` is locally installed}
}
...
...
@@ -42,7 +42,13 @@ findNLDI(
a list of data.frames
}
\description{
Provides a formal query to the \href{https://labs.waterdata.usgs.gov/about-nldi/index.html}{Network Linked Data Index}. The function is useful for topology and location based featrue discovery. A user must supply a starting feature, and can add optional navigation direction(s), and features to identify on the navigated networks. Valid starting options can be given by one of the following arguments: comid, nwis, huc12, wqp, location, and start.
Provides a formal query to the
\href{https://labs.waterdata.usgs.gov/about-nldi/index.html}{Network Linked Data Index}.
The function is useful for topology and location based feature discovery.
A user must supply a starting feature, and can add optional navigation direction(s),
and features to identify on the navigated network.
Valid starting options can be given by one of the following arguments: comid, nwis, huc12,
\item{type}{the type of data being returned (nav or feature)}
\item{use_sf}{should a local sf install be usedto parse data}
}
\value{
a data.frame
}
\description{
Queries the NLDI for a given URL. If local sf install is available the function returns a data.frame with the sfc geometry column listed. Such an object can be converted to sf with `sf::st_as_sf()`. If the object requested is a POINT object, the XY coordinates are added as columns. Otherwise the columns returned are "sourceName" and "identifier" for features, and "nhdplus_comid" for navigated paths.
}
\examples{
\dontrun{
base = "https://labs.waterdata.usgs.gov/api/nldi/linked-data/"
get_nldi(paste0(base, "comid/101"), type = "feature", use_sf = FALSE)
get_nldi(paste0(base, "comid/101"), type = "feature", use_sf = TRUE)
get_nldi(paste0(base, "nwissite/USGS-11120000"), type = "feature", use_sf = TRUE)
get_nldi(paste0(base, "nwissite/USGS-11120000"), type = "feature", use_sf = TRUE)