header_tag.html

Skip to contents

This endpoint combines metadata from timeseries and field measurements collections by site.

Usage

read_waterdata_combined_meta(
  monitoring_location_id = NA_character_,
  parameter_code = NA_character_,
  parameter_name = NA_character_,
  unit_of_measure = NA_character_,
  statistic_id = NA_character_,
  parameter_description = NA_character_,
  data_type = NA_character_,
  computation_identifier = NA_character_,
  computation_period_identifier = NA_character_,
  thresholds = NA_character_,
  sublocation_identifier = NA_character_,
  primary = NA_character_,
  web_description = NA_character_,
  parent_time_series_id = NA_character_,
  begin = NA_character_,
  end = NA_character_,
  last_modified = NA_character_,
  agency_code = NA_character_,
  agency_name = NA_character_,
  monitoring_location_number = NA_character_,
  monitoring_location_name = NA_character_,
  district_code = NA_character_,
  country_code = NA_character_,
  country_name = NA_character_,
  state_code = NA_character_,
  state_name = NA_character_,
  county_code = NA_character_,
  county_name = NA_character_,
  minor_civil_division_code = NA_character_,
  site_type_code = NA_character_,
  site_type = NA_character_,
  hydrologic_unit_code = NA_character_,
  basin_code = NA_character_,
  altitude = NA_character_,
  altitude_accuracy = NA_character_,
  altitude_method_code = NA_character_,
  altitude_method_name = NA_character_,
  vertical_datum = NA_character_,
  vertical_datum_name = NA_character_,
  horizontal_positional_accuracy_code = NA_character_,
  horizontal_positional_accuracy = NA_character_,
  horizontal_position_method_code = NA_character_,
  horizontal_position_method_name = NA_character_,
  original_horizontal_datum = NA_character_,
  original_horizontal_datum_name = NA_character_,
  drainage_area = NA_character_,
  contributing_drainage_area = NA_character_,
  time_zone_abbreviation = NA_character_,
  uses_daylight_savings = NA_character_,
  construction_date = NA_character_,
  aquifer_code = NA_character_,
  national_aquifer_code = NA_character_,
  aquifer_type_code = NA_character_,
  well_constructed_depth = NA_character_,
  hole_constructed_depth = NA_character_,
  depth_source_code = NA_character_,
  properties = NA_character_,
  skipGeometry = NA,
  bbox = NA,
  limit = NA,
  convertType = TRUE,
  no_paging = FALSE
)

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

Multiple monitoring_location_ids can be requested as a character vector.

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://api.waterdata.usgs.gov/ogcapi/v0/collections/parameter-codes/items.

Multiple parameter_codes can be requested as a character vector.

parameter_name

A human-understandable name corresponding to parameter_code. Multiple parameter_names can be requested as a character vector.

unit_of_measure

A human-readable description of the units of measurement associated with an observation.

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://api.waterdata.usgs.gov/ogcapi/v0/collections/statistic-codes/items.

Multiple statistic_ids can be requested as a character vector.

parameter_description

A description of what the parameter code represents, as used by WDFN and other USGS data dissemination products.

data_type

The computational period type of data collected at the monitoring location.

computation_identifier

Multiple computation_identifiers can be requested as a character vector.

computation_period_identifier

Multiple computation_period_identifiers can be requested as a character vector.

thresholds

Thresholds represent known numeric limits for a time series, for example the historic maximum value for a parameter or a level below which a sensor is non-operative. These thresholds are sometimes used to automatically determine if an observation is erroneous due to sensor error, and therefore shouldn't be included in the time series.

sublocation_identifier

An optional human-readable identifier used to specify where measurements are recorded at a monitoring location.

primary

A flag identifying if the time series is a "primary" time series. "Primary" time series (which have this flag) are standard observations which undergo Bureau review and approval processes. Non-primary time series, which will have missing values for "primary", are provisional datasets made available to meet the need for timely best science and to assist with daily operations which need real-time information. Non-primary time series data are only retained by this system for 120 days. See the USGS Provisional Data Statement for more information.

web_description

A description of what this time series represents, as used by WDFN and other USGS data dissemination products.

parent_time_series_id

The unique identifier representing the parent or "upchain" time series that a daily values time series is generated from. Daily values time series have one and only one parent time series.

begin

This field contains the same information as "begin_utc", but in the local time of the monitoring location. It is retained for backwards compatibility, but will be removed in V1 of these APIs.

See also Details below for more information.

end

This field contains the same information as "end_utc", but in the local time of the monitoring location. It is retained for backwards compatibility, but will be removed in V1 of these APIs.

See also Details below for more information.

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.

See also Details below for more information.

agency_code

The agency that is reporting the data. Agency codes are fixed values assigned by the National Water Information System (NWIS). A list of agency codes is available at https://api.waterdata.usgs.gov/ogcapi/v0/collections/agency-codes/items.

agency_name

The name of the agency that is reporting the data.

monitoring_location_number

Each monitoring location in the USGS data base has a unique 8- to 15-digit identification number.

monitoring_location_name

This is the official name of the monitoring location in the database. For well information this can be a district-assigned local number.

district_code

The Water Science Centers (WSCs) across the United States use the FIPS state code as the district code. In some case, monitoring locations and samples may be managed by a water science center that is adjacent to the state in which the monitoring location actually resides. For example a monitoring location may have a district code of 30 which translates to Montana, but the state code could be 56 for Wyoming because that is where the monitoring location actually is located.

country_code

The code for the country in which the monitoring location is located.

country_name

The name of the country in which the monitoring location is located.

state_code

State code. A two-digit ANSI code (formerly FIPS code) as defined by the American National Standards Institute, to define States and equivalents. A three-digit ANSI code is used to define counties and county equivalents. A lookup table is available. The only countries with political subdivisions other than the US are Mexico and Canada. The Mexican states have US state codes ranging from 81-86 and Canadian provinces have state codes ranging from 90-98.

state_name

The name of the state or state equivalent in which the monitoring location is located.

county_code

The code for the county or county equivalent (parish, borough, etc.) in which the monitoring location is located. A list of codes is available at https://api.waterdata.usgs.gov/ogcapi/v0/collections/counties/items.

county_name

The name of the county or county equivalent (parish, borough, etc.) in which the monitoring location is located. [A list of codes is available at https://api.waterdata.usgs.gov/ogcapi/v0/collections/counties/items.

minor_civil_division_code

Codes for primary governmental or administrative divisions of the county or county equivalent in which the monitoring location is located.

site_type_code

A code describing the hydrologic setting of the monitoring location. A list of codes is available at https://api.waterdata.usgs.gov/ogcapi/v0/collections/site-types/items.

site_type

A description of the hydrologic setting of the monitoring location. A list of codes is available at https://api.waterdata.usgs.gov/ogcapi/v0/collections/site-types/items.

hydrologic_unit_code

The United States is divided and sub-divided into successively smaller hydrologic units which are classified into four levels: regions, sub-regions, accounting units, and cataloging units. The hydrologic units are arranged within each other, from the smallest (cataloging units) to the largest (regions). Each hydrologic unit is identified by a unique hydrologic unit code (HUC) consisting of two to eight digits based on the four levels of classification in the hydrologic unit system.

basin_code

The Basin Code or "drainage basin code" is a two-digit code that further subdivides the 8-digit hydrologic-unit code. The drainage basin code is defined by the USGS State Office where the monitoring location is located.

altitude

Altitude of the monitoring location referenced to the specified Vertical Datum.

altitude_accuracy

Accuracy of the altitude, in feet. An accuracy of +/- 0.1 foot would be entered as “.1”. Many altitudes are interpolated from the contours on topographic maps; accuracies determined in this way are generally entered as one-half of the contour interval.

altitude_method_code

Codes representing the method used to measure altitude.

altitude_method_name
vertical_datum

The datum used to determine altitude and vertical position at the monitoring location. A list of codes is available at https://api.waterdata.usgs.gov/ogcapi/v0/collections/altitude-datums/items.

vertical_datum_name

The datum used to determine altitude and vertical position at the monitoring location. A list of codes is available at https://api.waterdata.usgs.gov/ogcapi/v0/collections/altitude-datums/items.

horizontal_positional_accuracy_code

Indicates the accuracy of the latitude longitude values. A list of codes is available at https://api.waterdata.usgs.gov/ogcapi/v0/collections/coordinate-accuracy-codes/items.

horizontal_positional_accuracy

Indicates the accuracy of the latitude longitude values. A list of codes is available at https://api.waterdata.usgs.gov/ogcapi/v0/collections/coordinate-accuracy-codes/items.

horizontal_position_method_code

Indicates the method used to determine latitude longitude values. A list of codes is available at https://api.waterdata.usgs.gov/ogcapi/v0/collections/coordinate-method-codes/items.

horizontal_position_method_name

Indicates the method used to determine latitude longitude values. A list of codes is available at https://api.waterdata.usgs.gov/ogcapi/v0/collections/coordinate-method-codes/items.

original_horizontal_datum

Coordinates are published in EPSG:4326 / WGS84 / World Geodetic System 1984. This field indicates the original datum used to determine coordinates before they were converted. A list of codes is available at https://api.waterdata.usgs.gov/ogcapi/v0/collections/coordinate-datum-codes/items.

original_horizontal_datum_name

Coordinates are published in EPSG:4326 / WGS84 / World Geodetic System 1984. This field indicates the original datum used to determine coordinates before they were converted. A list of codes is available at https://api.waterdata.usgs.gov/ogcapi/v0/collections/coordinate-datum-codes/items.

drainage_area

The area enclosed by a topographic divide from which direct surface runoff from precipitation normally drains by gravity into the stream above that point.

contributing_drainage_area

The contributing drainage area of a lake, stream, wetland, or estuary monitoring location, in square miles. This item should be present only if the contributing area is different from the total drainage area. This situation can occur when part of the drainage area consists of very porous soil or depressions that either allow all runoff to enter the groundwater or traps the water in ponds so that rainfall does not contribute to runoff. A transbasin diversion can also affect the total drainage area.

time_zone_abbreviation

A short code describing the time zone used by a monitoring location.

uses_daylight_savings

A flag indicating whether or not a monitoring location uses daylight savings.

construction_date

Date the well was completed.

aquifer_code

Local aquifers in the USGS water resources data base are identified by a geohydrologic unit code (a three-digit number related to the age of the formation, followed by a 4 or 5 character abbreviation for the geologic unit or aquifer name).

national_aquifer_code

National aquifers are the principal aquifers or aquifer systems in the United States, defined as regionally extensive aquifers or aquifer systems that have the potential to be used as a source of potable water. Not all groundwater monitoring locations can be associated with a National Aquifer. Such monitoring locations will not be retrieved using this search criteria. A list of National aquifer codes and names is available at https://api.waterdata.usgs.gov/ogcapi/v0/collections/national-aquifer-codes/items.

aquifer_type_code

Groundwater occurs in aquifers under two different conditions. Where water only partly fills an aquifer, the upper surface is free to rise and decline. These aquifers are referred to as unconfined (or water-table) aquifers. Where water completely fills an aquifer that is overlain by a confining bed, the aquifer is referred to as a confined (or artesian) aquifer. When a confined aquifer is penetrated by a well, the water level in the well will rise above the top of the aquifer (but not necessarily above land surface).

well_constructed_depth

The depth of the finished well, in feet below land surface datum. Note: Not all groundwater monitoring locations have information on Well Depth. Such monitoring locations will not be retrieved using this search criteria.

hole_constructed_depth

The total depth to which the hole is drilled, in feet below land surface datum. Note: Not all groundwater monitoring locations have information on Hole Depth. Such monitoring locations will not be retrieved using this search criteria.

depth_source_code

A code indicating the source of water-level data.

properties

A vector of requested columns to be returned from the query. Available options are: geometry, monitoring_location_id, agency_code, agency_name, monitoring_location_number, monitoring_location_name, district_code, country_code, country_name, state_code, state_name, county_code, county_name, minor_civil_division_code, site_type_code, site_type, hydrologic_unit_code, basin_code, altitude, altitude_accuracy, altitude_method_code, altitude_method_name, vertical_datum, vertical_datum_name, horizontal_positional_accuracy_code, horizontal_positional_accuracy, horizontal_position_method_code, horizontal_position_method_name, original_horizontal_datum, original_horizontal_datum_name, drainage_area, contributing_drainage_area, time_zone_abbreviation, uses_daylight_savings, construction_date, aquifer_code, national_aquifer_code, aquifer_type_code, well_constructed_depth, hole_constructed_depth, depth_source_code, field_measurement_id, unit_of_measure, parameter_name, parameter_code, statistic_id, last_modified, begin, end, data_type, computation_identifier, thresholds, sublocatio The default (NA) will return all columns of the data.

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.

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

convertType

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

no_paging

logical, defaults to FALSE. If TRUE, the data will be requested from a native csv format. This can be dangerous because the data will cut off at 50,000 rows without indication that more data is available. Use TRUE with caution.

Details

You can also use a vector of length 2 for any time queries (such as time or last_modified). The first value is the starting date (or datetime), the second value is the ending date(or datetime). NA's within the vector indicate a half-bound date. For example, time = c("2024-01-01", NA) will return all data starting at 2024-01-01. time = c(NA, "2024-01-01") will return all data from the beginning of the timeseries until 2024-01-01. By default, time is assumed UTC, although time zone attributes will be accommodated. As an example, setting time = as.POSIXct(c("2021-01-01 12:00:00", "2021-01-01 14:00"), tz = "America/New_York") will request data that between noon and 2pm eastern time on 2021-01-01. All time values RETURNED from the service are UTC with the exception of daily data, which returns time values in local dates.

Examples


# \donttest{
site <- "USGS-05407000"
available_data_sf <- read_waterdata_combined_meta(monitoring_location_id = site)
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/combined-metadata/items?f=json&lang=en-US&monitoring_location_id=USGS-05407000&limit=50000
#> Remaining requests this hour:2949 

groundwater <- read_waterdata_combined_meta(monitoring_location_id = "USGS-375907091432201")
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/combined-metadata/items?f=json&lang=en-US&monitoring_location_id=USGS-375907091432201&limit=50000
#> Remaining requests this hour:2949 

date_wi_data <- read_waterdata_combined_meta(state_name = "Wisconsin",
                                        county_name = "Dane County")
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/combined-metadata/items?f=json&lang=en-US&state_name=Wisconsin&county_name=Dane%20County&limit=50000
#> ⠙ iterating 1 done (0.41/s) | 2.4s
#> Remaining requests this hour:2948 


multi_site <- read_waterdata_combined_meta(
                              monitoring_location_id =  c("USGS-451605097071701",
                                                          "USGS-263819081585801"),
                              parameter_code = c("62611", "72019"))
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/combined-metadata/items?f=json&lang=en-US&monitoring_location_id=USGS-451605097071701,USGS-263819081585801&parameter_code=62611,72019&limit=50000

                                              
surface_water <- read_waterdata_combined_meta(
                         monitoring_location_id = c("USGS-07069000",
                                                    "USGS-07064000",
                                                    "USGS-07068000"),
                         #end = c("2024-07-01T00:00:00Z", NA),
                         parameter_code = "00060")
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/combined-metadata/items?f=json&lang=en-US&monitoring_location_id=USGS-07069000,USGS-07064000,USGS-07068000&parameter_code=00060&limit=50000


# }