header_tag.html

Skip to contents

Function to get metadata from Water Data API. These are useful to get the human readable words and other metadata associated with USGS codes.

Usage

read_waterdata_metadata(collection, max_results = NA, limit = NA)

Arguments

collection

character, can be any existing collection such as "parameter-codes", "agency-codes", "altitude-datums", "aquifer-codes", "aquifer-types", "coordinate-accuracy-codes", "coordinate-datum-codes", "coordinate-method-codes", "hydrologic-unit-codes", "medium-codes", "national-aquifer-codes", "reliability-codes", "site-types", "statistic-codes", "topographic-codes", "time-zone-codes".

max_results

The optional maximum number of rows to return. This value must be less than the requested limit.

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.

Examples


# \donttest{
agency_codes <- read_waterdata_metadata("agency-codes")
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/agency-codes/items?f=json&lang=en-US&skipGeometry=TRUE&limit=10000
#> Remaining requests this hour:444 
altitude_datums <- read_waterdata_metadata("altitude-datums")
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/altitude-datums/items?f=json&lang=en-US&skipGeometry=TRUE&limit=10000
#> Remaining requests this hour:444 
aquifer_codes <- read_waterdata_metadata("aquifer-codes")
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/aquifer-codes/items?f=json&lang=en-US&skipGeometry=TRUE&limit=10000
#> Remaining requests this hour:444 
aquifer_types <- read_waterdata_metadata("aquifer-types")
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/aquifer-types/items?f=json&lang=en-US&skipGeometry=TRUE&limit=10000
#> Remaining requests this hour:441 
coordinate_accuracy_codes <- read_waterdata_metadata("coordinate-accuracy-codes")
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/coordinate-accuracy-codes/items?f=json&lang=en-US&skipGeometry=TRUE&limit=10000
#> Remaining requests this hour:441 
coordinate_datum_codes <- read_waterdata_metadata("coordinate-datum-codes")
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/coordinate-datum-codes/items?f=json&lang=en-US&skipGeometry=TRUE&limit=10000
#> Remaining requests this hour:440 
coordinate_method_codes <- read_waterdata_metadata("coordinate-method-codes")
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/coordinate-method-codes/items?f=json&lang=en-US&skipGeometry=TRUE&limit=10000
#> Remaining requests this hour:441 
huc_codes <- read_waterdata_metadata("hydrologic-unit-codes")
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/hydrologic-unit-codes/items?f=json&lang=en-US&skipGeometry=TRUE&limit=10000
#> Remaining requests this hour:438 
#> Remaining requests this hour:437 
#> Remaining requests this hour:431 
#> Remaining requests this hour:430 
#> Remaining requests this hour:428 
#> ⠙ iterating 6 done (2.9/s) | 2.1s
#> Remaining requests this hour:426 
#> Remaining requests this hour:423 
#> Remaining requests this hour:423 
#> Remaining requests this hour:423 
#> Remaining requests this hour:421 
#> ⠹ iterating 11 done (2.3/s) | 4.9s
#> Remaining requests this hour:420 
#> Remaining requests this hour:419 
#> Remaining requests this hour:418 
#> ⠹ iterating 13 done (2/s) | 6.5s
national_aquifer_codes <- read_waterdata_metadata("national-aquifer-codes")
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/national-aquifer-codes/items?f=json&lang=en-US&skipGeometry=TRUE&limit=10000
#> Remaining requests this hour:397 
parameter_codes <- read_waterdata_metadata("parameter-codes")
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/parameter-codes/items?f=json&lang=en-US&skipGeometry=TRUE&limit=10000
#> Remaining requests this hour:396 
#> Remaining requests this hour:396 
reliability_codes <- read_waterdata_metadata("reliability-codes")
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/reliability-codes/items?f=json&lang=en-US&skipGeometry=TRUE&limit=10000
#> Remaining requests this hour:394 
site_types <- read_waterdata_metadata("site-types")
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/site-types/items?f=json&lang=en-US&skipGeometry=TRUE&limit=10000
#> Remaining requests this hour:394 
statistic_codes <- read_waterdata_metadata("statistic-codes")
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/statistic-codes/items?f=json&lang=en-US&skipGeometry=TRUE&limit=10000
#> Remaining requests this hour:393 
topographic_codes <- read_waterdata_metadata("topographic-codes")
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/topographic-codes/items?f=json&lang=en-US&skipGeometry=TRUE&limit=10000
#> Remaining requests this hour:391 
time_zone_codes <- read_waterdata_metadata("time-zone-codes")
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/time-zone-codes/items?f=json&lang=en-US&skipGeometry=TRUE&limit=10000
#> Remaining requests this hour:391 
# }