
Get USGS Field Measurement Water Data
Source:R/read_waterdata_field_measurements.R
read_waterdata_field_measurements.Rd
Field measurements are physically measured values collected during a visit to the monitoring location. Field measurements consist of measurements of gage height and discharge, and readings of groundwater levels, and are primarily used as calibration readings for the automated sensors collecting continuous data. They are collected at a low frequency, and delivery of the data in WDFN may be delayed due to data processing time.
Usage
read_waterdata_field_measurements(
monitoring_location_id = NA_character_,
parameter_code = NA_character_,
observing_procedure_code = NA_character_,
properties = NA_character_,
field_visit_id = NA_character_,
approval_status = NA_character_,
unit_of_measure = NA_character_,
qualifier = NA_character_,
value = NA,
last_modified = NA_character_,
observing_procedure = NA_character_,
vertical_datum = NA_character_,
measuring_agency = NA_character_,
skipGeometry = NA,
time = NA_character_,
bbox = NA,
limit = NA,
max_results = NA,
convertType = TRUE
)
Arguments
- monitoring_location_id
A unique identifier representing a single monitoring location. This corresponds to the
id
field in themonitoring-locations
endpoint. Monitoring location IDs are created by combining the agency code of the agency responsible for the monitoring location (e.g. USGS) with the ID number of the monitoring location (e.g. 02238500), separated by a hyphen (e.g. USGS-02238500).- parameter_code
Parameter codes are 5-digit codes used to identify the constituent measured and the units of measure. A complete list of parameter codes and associated groupings can be found at https://help.waterdata.usgs.gov/codes-and-parameters/parameters.
- observing_procedure_code
A short code corresponding to the observing procedure for the field measurement.
- properties
A vector of requested columns to be returned from the query. Available options are: geometry, id, field_visit_id, parameter_code, monitoring_location_id, observing_procedure_code, observing_procedure, value, unit_of_measure, time, qualifier, vertical_datum, approval_status, measuring_agency, last_modified
- field_visit_id
A universally unique identifier (UUID) for the field visit. Multiple measurements may be made during a single field visit.
- approval_status
Some of the data that you have obtained from this U.S. Geological Survey database may not have received Director's approval. Any such data values are qualified as provisional and are subject to revision. Provisional data are released on the condition that neither the USGS nor the United States Government may be held liable for any damages resulting from its use. This field reflects the approval status of each record, and is either "Approved", meaining processing review has been completed and the data is approved for publication, or "Provisional" and subject to revision. For more information about provisional data, go to https://waterdata.usgs.gov/provisional-data-statement/.
- unit_of_measure
A human-readable description of the units of measurement associated with an observation.
- qualifier
This field indicates any qualifiers associated with an observation, for instance if a sensor may have been impacted by ice or if values were estimated.
- value
The value of the observation. Values are transmitted as strings in the JSON response format in order to preserve precision.
- last_modified
The last time a record was refreshed in our database. This may happen due to regular operational processes and does not necessarily indicate anything about the measurement has changed. You can query this field using date-times or intervals, adhering to RFC 3339, or using ISO 8601 duration objects. Intervals may be bounded or half-bounded (double-dots at start or end). Examples:
A date-time: "2018-02-12T23:20:50Z"
A bounded interval: "2018-02-12T00:00:00Z/2018-03-18T12:31:12Z"
Half-bounded intervals: "2018-02-12T00:00:00Z/.." or "../2018-03-18T12:31:12Z"
Duration objects: "P1M" for data from the past month or "PT36H" for the last 36 hours
Only features that have a
last_modified
that intersects the value of datetime are selected.- observing_procedure
Water measurement or water-quality observing procedure descriptions.
- vertical_datum
The datum used to determine altitude and vertical position at the monitoring location. A list of codes is available.
- measuring_agency
The agency performing the measurement.
- skipGeometry
This option can be used to skip response geometries for each feature. The returning object will be a data frame with no spatial information.
- time
The date an observation represents. You can query this field using date-times or intervals, adhering to RFC 3339, or using ISO 8601 duration objects. Intervals may be bounded or half-bounded (double-dots at start or end). Examples:
A date-time: "2018-02-12T23:20:50Z"
A bounded interval: "2018-02-12T00:00:00Z/2018-03-18T12:31:12Z"
Half-bounded intervals: "2018-02-12T00:00:00Z/.." or "../2018-03-18T12:31:12Z"
Duration objects: "P1M" for data from the past month or "PT36H" for the last 36 hours
Only features that have a
time
that intersects the value of datetime are selected. If a feature has multiple temporal properties, it is the decision of the server whether only a single temporal property is used to determine the extent or all relevant temporal properties.- bbox
Only features that have a geometry that intersects the bounding box are selected.The bounding box is provided as four or six numbers, depending on whether the coordinate reference system includes a vertical axis (height or depth). Coordinates are assumed to be in crs 4326. The expected format is a numeric vector structured: c(xmin,ymin,xmax,ymax). Another way to think of it is c(Western-most longitude, Southern-most latitude, Eastern-most longitude, Northern-most longitude).
- limit
The optional limit parameter is used to control the subset of the selected features that should be returned in each page. The maximum allowable limit is 10000. It may be beneficial to set this number lower if your internet connection is spotty. The default (
NA
) will set the limit to the maximum allowable limit for the service.- max_results
The optional maximum number of rows to return. This value must be less than the requested limit.
- convertType
logical, defaults to
TRUE
. IfTRUE
, the function will convert the data to dates and qualifier to string vector.
Examples
# \donttest{
site <- "USGS-02238500"
field_data_sf <- read_waterdata_field_measurements(monitoring_location_id = site)
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/field-measurements/items?f=json&lang=en-US&limit=10000&monitoring_location_id=USGS-02238500
#> ⠙ iterating 1 done (0.32/s) | 3.2s
#> Remaining requests this hour:947
groundwater <- read_waterdata_field_measurements(monitoring_location_id = "USGS-375907091432201")
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/field-measurements/items?f=json&lang=en-US&limit=10000&monitoring_location_id=USGS-375907091432201
#> ⠙ iterating 1 done (0.32/s) | 3.1s
#> Remaining requests this hour:945
gwl_data <- read_waterdata_field_measurements(monitoring_location_id = "USGS-375907091432201",
parameter_code = "72019",
skipGeometry = TRUE)
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/field-measurements/items?f=json&lang=en-US&skipGeometry=TRUE&limit=10000&monitoring_location_id=USGS-375907091432201¶meter_code=72019
#> ⠙ iterating 1 done (0.32/s) | 3.1s
#> Remaining requests this hour:944
gwl_data_period <- read_waterdata_field_measurements(
monitoring_location_id = "USGS-375907091432201",
parameter_code = "72019",
time = "P20Y")
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/field-measurements/items?f=json&lang=en-US&limit=10000&monitoring_location_id=USGS-375907091432201¶meter_code=72019&time=P20Y
#> ⠙ iterating 1 done (0.33/s) | 3s
#> Remaining requests this hour:943
multi_site <- read_waterdata_field_measurements(
monitoring_location_id = c("USGS-451605097071701",
"USGS-263819081585801"),
parameter_code = c("62611", "72019"))
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/field-measurements/items?f=json&lang=en-US&limit=10000
#> ⠙ iterating 1 done (0.27/s) | 3.7s
#> Remaining requests this hour:942
old_df <- read_waterdata_field_measurements(monitoring_location_id = "USGS-425957088141001",
time = c("1980-01-01", NA))
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/field-measurements/items?f=json&lang=en-US&limit=10000&monitoring_location_id=USGS-425957088141001&time=1980-01-01T00%3A00%3A00Z%2F..
#> ⠙ iterating 1 done (0.3/s) | 3.3s
#> Remaining requests this hour:941
# }