View source: R/construct_api_requests.R
| construct_api_requests | R Documentation |
Main documentation: https://api.waterdata.usgs.gov/ogcapi/v0/, Swagger docs: https://api.waterdata.usgs.gov/ogcapi/v0/openapi?f=html.
construct_api_requests(
service,
output_id,
...,
bbox = NA,
convertType = getOption("dataRetrieval.convertType"),
no_paging = getOption("dataRetrieval.no_paging"),
chunk_size = getOption("dataRetrieval.site_chunk_size_data"),
limit = getOption("dataRetrieval.limit"),
attach_request = getOption("dataRetrieval.attach_request")
)
service |
Which service available on https://api.waterdata.usgs.gov/ogcapi/v0/. |
output_id |
Name of id column to return |
... |
Extra parameters from the specific services. |
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). |
convertType |
logical, defaults to TRUE.
If |
no_paging |
logical, defaults to FALSE.
If |
chunk_size |
Number of monitoring_location_ids to chunk requests into.
The default for functions that don't generally return long-term data records
is 250, while
the default for time series functions is
10.
Setting to |
limit |
numeric, 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 50,000. It may be beneficial to set this number lower if your internet
connection is spotty. The default ( |
attach_request |
logical, defaults to TRUE.
If set to |
site <- "USGS-02238500"
pcode <- "00060"
req_dv <- construct_api_requests("daily",
output_id = "daily_id",
monitoring_location_id = site,
parameter_code = "00060")
req_dv <- construct_api_requests("daily",
output_id = "daily_id",
monitoring_location_id = site,
parameter_code = c("00060", "00065"))
sites <- c("USGS-01491000", "USGS-01645000")
start_date <- "2018-01-01"
end_date <- "2022-01-01"
req_dv <- construct_api_requests("daily",
output_id = "daily_id",
monitoring_location_id = sites,
parameter_code = c("00060", "00065"),
datetime = c(start_date, end_date))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.