river_discharge: Retrieve river discharge data from the Open-Meteo API

View source: R/river_discharge.R

river_dischargeR Documentation

Retrieve river discharge data from the Open-Meteo API

Description

river_discharge() calls the Open-Meteo Global Flood API to obtain simulated river discharge from the nearest river. Data obtained from the Global Flood Awareness System (GloFAS). Forecasts and historical data is available.

Refer to the API documentation at: https://open-meteo.com/en/docs/flood-api

Usage

river_discharge(location, start = NULL, end = NULL, daily = NULL, model = NULL)

Arguments

location

Required. The location for which data will be retrieved. Supplied as either a c(latitude,longitude) WGS84 coordinate pair or a place name string (with co-ordinates obtained via geocode()).

start, end

Start and end dates in ISO 8601 (e.g. "2020-12-31"). If no dates are supplied, data for the next 3 months will be provided by default.

daily

Required. A weather variable accepted by the API, or list thereof. See details below.

model

Supply to specify a model for forecasted values (defaults to latest GloFAS model).

Details

You will need to specify at least one river discharge variable to retrieve data for. These variables are sampled or aggregated at daily intervals, and can be supplied as a list to request multiple variables over the same time period.

Example daily forecast variables include:

Variable Description
river_discharge Daily river discharge rate in m³/s
river_discharge_median Median over ensemble members (forecasts only)
river_discharge_max Maximum over ensemble members (forecasts only)

Full documentation for the forecast API is available at: https://open-meteo.com/en/docs/flood-api

Value

Requested river discharge data (m³/s) for the given location and time period, as a tidy tibble.

Examples


# obtain historical flood data for Brisbane
river_discharge("Brisbane",
  "2022-01-01", "2022-02-01",
  daily = "river_discharge"
)


openmeteo documentation built on Oct. 25, 2023, 5:07 p.m.