header_tag.html

Skip to contents

Description Daily data provide one data value to represent water conditions for the day. Throughout much of the history of the USGS, the primary water data available was daily data collected manually at the monitoring location once each day. With improved availability of computer storage and automated transmission of data, the daily data published today are generally a statistical summary or metric of the continuous data collected each day, such as the daily mean, minimum, or maximum value. Daily data are automatically calculated from the continuous data of the same parameter code and are described by parameter code and a statistic code. These data have also been referred to as “daily values” or “DV”.

Usage

read_USGS_dv(
  monitoring_location_id = NA_character_,
  parameter_code = NA_character_,
  statistic_id = NA_character_,
  properties = NA_character_,
  bbox = NA,
  time_series_id = NA_character_,
  daily_id = NA_character_,
  approval_status = NA_character_,
  unit_of_measure = NA_character_,
  qualifier = NA_character_,
  value = NA,
  last_modified = NA_character_,
  limit = 10000,
  crs = NA_character_,
  skipGeometry = NA,
  time = NA_character_,
  convertType = TRUE
)

Arguments

monitoring_location_id

A unique identifier representing a single monitoring location. This corresponds to the id field in the monitoring-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.

statistic_id

A code corresponding to the statistic an observation represents. Example codes include 00001 (max), 00002 (min), and 00003 (mean). A complete list of codes and their descriptions can be found at https://help.waterdata.usgs.gov/code/stat_cd_nm_query?stat_nm_cd=%25&fmt=html.

properties

The properties that should be included for each feature. The parameter value is a comma-separated list of property names. Available options are geometry, id, time_series_id, monitoring_location_id, parameter_code, statistic_id, time, value, unit_of_measure, approval_status, qualifier, last_modified

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.

time_series_id

A unique identifier representing a single time series. This corresponds to the id field in the time-series-metadata endpoint.

daily_id

A universally unique identifier (UUID) representing a single version of a record. It is not stable over time. Every time the record is refreshed in our database (which may happen as part of normal operations and does not imply any change to the data itself) a new ID will be generated. To uniquely identify a single observation over time, compare the time and time_series_id fields; each time series will only have a single observation at a given time.

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. 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.

limit

The optional limit parameter limits the number of items that are presented in the response document. Only items are counted that are on the first level of the collection in the response document. Nested objects contained within the explicitly requested items shall not be counted.

crs

Indicates the coordinate reference system for the results.

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.

convertType

logical, defaults to TRUE. If TRUE, the function will convert the data to dates and qualifier to string vector.

Examples


# \donttest{
site <- "USGS-02238500"
pcode <- "00060"
dv_data_sf <- read_USGS_dv(monitoring_location_id = site,
                        parameter_code = "00060", 
                        time = c("2021-01-01", "2022-01-01"))
#> Function in development, use at your own risk.
#> GET: https://api.waterdata.usgs.gov/ogcapi/v0/collections/daily/items?f=json&lang=en-US&limit=10000&monitoring_location_id=USGS-02238500&parameter_code=00060&time=2021-01-01T00%3A00%3A00Z%2F2022-01-01T00%3A00%3A00Z
#> Remaining requests this hour:

dv_data_trim <- read_USGS_dv(monitoring_location_id = site,
                          parameter_code = "00060", 
                          properties = c("monitoring_location_id",
                                         "value",
                                         "time"),
                          time = c("2021-01-01", "2022-01-01"))
#> Function in development, use at your own risk.
#> GET: https://api.waterdata.usgs.gov/ogcapi/v0/collections/daily/items?f=json&lang=en-US&limit=10000&properties=monitoring_location_id%2Cvalue%2Ctime&monitoring_location_id=USGS-02238500&parameter_code=00060&time=2021-01-01T00%3A00%3A00Z%2F2022-01-01T00%3A00%3A00Z
#> Remaining requests this hour:

dv_data <- read_USGS_dv(monitoring_location_id = site,
                        parameter_code = "00060",
                        skipGeometry = TRUE)
#> Function in development, use at your own risk.
#> GET: https://api.waterdata.usgs.gov/ogcapi/v0/collections/daily/items?f=json&lang=en-US&skipGeometry=TRUE&limit=10000&monitoring_location_id=USGS-02238500&parameter_code=00060
#> Remaining requests this hour:

multi_site <- read_USGS_dv(monitoring_location_id =  c("USGS-01491000", 
                                                       "USGS-01645000"),
                        parameter_code = c("00060", "00010"),
                        time = c("2023-01-01", "2024-01-01"))
#> Function in development, use at your own risk.
#> POST: https://api.waterdata.usgs.gov/ogcapi/v0/collections/daily/items?f=json&lang=en-US&time=2023-01-01T00%3A00%3A00Z%2F2024-01-01T00%3A00%3A00Z&limit=10000
#> Remaining requests this hour:

# }