header_tag.html

Skip to contents

Returns a list of sites from the Water Quality Portal web service. This function gets the data from: https://www.waterqualitydata.us. Arguments to the function should be based on https://www.waterqualitydata.us/webservices_documentation. The return from this function returns the basic metadata on WQP sites. It is generally faster than the whatWQPdata function, but does not return information on what data was collected at the site.

Usage

whatWQPsamples(..., convertType = TRUE, legacy = TRUE)

whatWQPmetrics(..., convertType = TRUE)

whatWQPsites(..., legacy = TRUE, convertType = TRUE)

Arguments

...

see https://www.waterqualitydata.us/webservices_documentation for a complete list of options. A list of arguments can also be supplied. One way to figure out how to construct a WQP query is to go to the "Advanced" form in the Water Quality Portal: https://www.waterqualitydata.us/#mimeType=csv&providers=NWIS&providers=STORET Use the form to discover what parameters are available. Once the query is set in the form, scroll down to the "Query URL". You will see the parameters after "https://www.waterqualitydata.us/#". For example, if you chose "Nutrient" in the Characteristic Group dropdown, you will see characteristicType=Nutrient in the Query URL. The corresponding argument for dataRetrieval is characteristicType = "Nutrient". dataRetrieval users do not need to include mimeType, and providers is optional (these arguments are picked automatically).

convertType

logical, defaults to TRUE. If TRUE, the function will convert the data to dates, datetimes, numerics based on a standard algorithm. If false, everything is returned as a character.

legacy

Logical. If TRUE, uses legacy WQP services. Default is TRUE. Setting legacy = FALSE uses WQX3.0 WQP services, which are in-development, use with caution.

Value

A data frame with information on the sampling activity available from the Water Quality Portal for the query parameters.

data frame that includes information on site metadata.

See also

whatWQPdata readWQPsummary

whatNWISdata

Examples

# \donttest{

site1 <- whatWQPsamples(siteid = "USGS-01594440")
#> GET:https://www.waterqualitydata.us/data/Activity/search?siteid=USGS-01594440&mimeType=csv&count=no
#> NEWS: Data does not include USGS data newer than March 11, 2024. More details:
#> https://doi-usgs.github.io/dataRetrieval/articles/Status.html

type <- "Stream"

sites <- whatWQPsamples(countycode = "US:55:025", siteType = type)
#> GET:https://www.waterqualitydata.us/data/Activity/search?countycode=US%3A55%3A025&siteType=Stream&mimeType=csv&count=no
#> Waiting 2s for throttling delay ■■■■■■■■■■■■■■■                 
#> Waiting 2s for throttling delay ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■  
#> NEWS: Data does not include USGS data newer than March 11, 2024. More details:
#> https://doi-usgs.github.io/dataRetrieval/articles/Status.html

lakeSites_samples <- whatWQPsamples(siteType = "Lake, Reservoir, Impoundment",
                                    countycode = "US:55:025")
#> GET:https://www.waterqualitydata.us/data/Activity/search?siteType=Lake%2C%20Reservoir%2C%20Impoundment&countycode=US%3A55%3A025&mimeType=csv&count=no
#> NEWS: Data does not include USGS data newer than March 11, 2024. More details:
#> https://doi-usgs.github.io/dataRetrieval/articles/Status.html
# }
# \donttest{

type <- "Stream"

sites <- whatWQPmetrics(countycode = "US:55:025", siteType = type)
#> GET:https://www.waterqualitydata.us/data/ActivityMetric/search?countycode=US%3A55%3A025&siteType=Stream&mimeType=csv&count=no
#> NEWS: Data does not include USGS data newer than March 11, 2024. More details:
#> https://doi-usgs.github.io/dataRetrieval/articles/Status.html
lakeSites_metrics <- whatWQPmetrics(siteType = "Lake, Reservoir, Impoundment",
                                    countycode = "US:55:025")
#> GET:https://www.waterqualitydata.us/data/ActivityMetric/search?siteType=Lake%2C%20Reservoir%2C%20Impoundment&countycode=US%3A55%3A025&mimeType=csv&count=no
#> NEWS: Data does not include USGS data newer than March 11, 2024. More details:
#> https://doi-usgs.github.io/dataRetrieval/articles/Status.html
# }
# \donttest{

site1 <- whatWQPsites(siteid = "USGS-01594440")
#> GET:https://www.waterqualitydata.us/data/Station/search?siteid=USGS-01594440&mimeType=csv&count=no

type <- "Stream"
sites <- whatWQPsites(
  countycode = "US:55:025",
  characteristicName = "Phosphorus",
  siteType = type
)
#> GET:https://www.waterqualitydata.us/data/Station/search?countycode=US%3A55%3A025&characteristicName=Phosphorus&siteType=Stream&mimeType=csv&count=no
#> Waiting 2s for throttling delay ■■■■■■■■■■■■■■■                 
#> Waiting 2s for throttling delay ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■  
# }