header_tag.html

Skip to contents

Channel measurements taken as part of streamflow field measurements.

Usage

read_waterdata_channel(
  monitoring_location_id = NA_character_,
  field_visit_id = NA_character_,
  measurement_number = NA_character_,
  time = NA_character_,
  channel_name = NA_character_,
  channel_flow = NA_character_,
  channel_flow_unit = NA_character_,
  channel_width = NA_character_,
  channel_width_unit = NA_character_,
  channel_area = NA_character_,
  channel_area_unit = NA_character_,
  channel_velocity = NA_character_,
  channel_velocity_unit = NA_character_,
  channel_location_distance = NA_character_,
  channel_location_distance_unit = NA_character_,
  channel_stability = NA_character_,
  channel_material = NA_character_,
  channel_evenness = NA_character_,
  horizontal_velocity_description = NA_character_,
  vertical_velocity_description = NA_character_,
  longitudinal_velocity_description = NA_character_,
  measurement_type = NA_character_,
  last_modified = NA_character_,
  channel_measurement_type = 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.

field_visit_id

A universally unique identifier (UUID) for the field visit. Multiple measurements may be made during a single field visit.

measurement_number

Measurement number.

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.

channel_name

The channel name.

channel_flow

Channel discharge.

channel_flow_unit

The units for channel discharge.

channel_width

The channel width.

channel_width_unit

The units for channel width.

channel_area

The channel area.

channel_area_unit

The units for channel area.

channel_velocity

The mean channel velocity.

channel_velocity_unit

The units for channel velocity.

channel_location_distance

The channel location distance.

channel_location_distance_unit

The units for channel location distance.

channel_stability

The stability of the channel material.

channel_material

The channel material.

channel_evenness

The channel evenness from bank to bank.

horizontal_velocity_description

The horizontal velocity description.

vertical_velocity_description

The vertical velocity description.

longitudinal_velocity_description

The longitudinal velocity description.

measurement_type

The measurement type.

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.

                               field_visit_id = NA_character_,

channel_measurement_type

The channel measurement type.

properties

A vector of requested columns to be returned from the query. Available options are: geometry, channel_measurements_id, monitoring_location_id, field_visit_id, measurement_number, time, channel_name, channel_flow, channel_flow_unit, channel_width, channel_width_unit, channel_area, channel_area_unit, channel_velocity, channel_velocity_unit, channel_location_distance, channel_location_distance_unit, channel_stability, channel_material, channel_evenness, horizontal_velocity_description, vertical_velocity_description, longitudinal_velocity_description, measurement_type, last_modified, channel_measurement_type. 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-02238500"
df <- read_waterdata_channel(monitoring_location_id = site)
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/channel-measurements/items?f=json&lang=en-US&monitoring_location_id=USGS-02238500&limit=50000
#> Remaining requests this hour:2950 

# }