View source: R/read_USGS_samples.R
construct_USGS_sample_request | R Documentation |
This function creates the call for discrete water quality samples data service described at https://waterdata.usgs.gov/download-samples. Note: all possible arguments are included, but it is strongly recommended to only use the NECESSARY arguments. Leave unnecessary arguments as the default NA.
construct_USGS_sample_request(
monitoringLocationIdentifier = NA,
siteTypeCode = NA,
boundingBox = NA,
hydrologicUnit = NA,
activityMediaName = NA,
characteristicGroup = NA,
characteristic = NA,
characteristicUserSupplied = NA,
activityStartDateLower = NA,
activityStartDateUpper = NA,
countryFips = NA,
stateFips = NA,
countyFips = NA,
projectIdentifier = NA,
recordIdentifierUserSupplied = NA,
siteTypeName = NA,
usgsPCode = NA,
pointLocationLatitude = NA,
pointLocationLongitude = NA,
pointLocationWithinMiles = NA,
dataType = "results",
dataProfile = NA
)
monitoringLocationIdentifier |
A monitoring location identifier has two parts: the agency code and the location number, separated by a dash (-). Location identifiers should be separated with commas, for example: AZ014-320821110580701, CAX01-15304600, USGS-040851385. Location numbers without an agency prefix are assumed to have the prefix USGS. |
siteTypeCode |
Site type code query parameter. See available
options by running |
boundingBox |
North and South are latitude values; East and West are longitude values. A vector of 4 (west, south, east, north) is expected. An example would be: c(-92.8, 44.2, -88.9, 46.0). |
hydrologicUnit |
Hydrologic Unit Codes (HUCs) identify physical areas within the US that drain to a certain portion of the stream network. This filter accepts values containing 2, 4, 6, 8, 10 or 12 digits. |
activityMediaName |
Sample media refers to the environmental medium that was sampled or analyzed. |
characteristicGroup |
Characteristic group is a broad category describing the sample.
See available options by running
|
characteristic |
Characteristic is a specific category describing the sample.
See available options by running
|
characteristicUserSupplied |
Observed property is the USGS term for the constituent sampled and the property name gives a detailed description of what was sampled. Observed property is mapped to characteristicUserSupplied and replaces the parameter name and pcode USGS previously used to describe discrete sample data. Find more information in the Observed Properties and Parameter Codes section of the Code Dictionary found here: https://waterdata.usgs.gov/code-dictionary/. |
activityStartDateLower |
The service will return records with dates earlier than the value entered for activityStartDateUpper. Can be an R Date object, or a string with format YYYY-MM-DD. The logic is inclusive, i.e. it will also return records that match the date. |
activityStartDateUpper |
The service will return records with dates later than the value entered for activityStartDateLower. Can be an R Date object, or a string with format YYYY-MM-DD. The logic is inclusive, i.e. it will also return records that match the date. |
countryFips |
Country query parameter. Do not set redundant parameters.
If another query parameter contains the country information, leave this parameter
set to the default NA. See available options by running |
stateFips |
State query parameter. To get a list of available state fips,
run |
countyFips |
County query parameter. To get a list of available counties,
run |
projectIdentifier |
Project identifier query parameter. This information would be needed from prior project information. |
recordIdentifierUserSupplied |
Record identifier, user supplied identifier. This information would be needed from the data supplier. |
siteTypeName |
Site type name query parameter. See available
options by running |
usgsPCode |
USGS parameter code. See available options by running
|
pointLocationLatitude |
Latitude for a point/radius query (decimal degrees). Must be used with pointLocationLongitude and pointLocationWithinMiles. |
pointLocationLongitude |
Longitude for a point/radius query (decimal degrees). Must be used with pointLocationLatitude and pointLocationWithinMiles. |
pointLocationWithinMiles |
Radius for a point/radius query. Must be used with pointLocationLatitude and pointLocationLongitude |
dataType |
Options include: "Results", "Monitoring locations", "Activities", "Projects", and "Organizations". |
dataProfile |
Profile depends on type. Options for "results" dataType are: "fullphyschem", "basicphyschem", "fullbio", "basicbio", "narrow", "resultdetectionquantitationlimit", "labsampleprep", "count". Options for "locations" are: "site" and "count". Options for "activities" are "sampact", "actmetric", "actgroup", and "count". Options for "projects" are: "project" and "projectmonitoringlocationweight". Options for "organizations" are: "organization" and "count". |
See also: https://api.waterdata.usgs.gov/samples-data/docs.
data frame returned from web service call.
req <- construct_USGS_sample_request(
monitoringLocationIdentifier = "USGS-04074950",
characteristicUserSupplied = "pH, water, unfiltered, field")
rawData <- importWQP(req)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.