get_flood_warnings: Get the current flood warnings from Environment Agency API.

View source: R/get_flood_warnings.R

get_flood_warningsR Documentation

Get the current flood warnings from Environment Agency API.

Description

The Environment Agency issue warnings of floods that cover specific warning or alert areas. The floods API provides a listing of all current such warnings and is updated every 15 minutes.

Usage

get_flood_warnings(
  min_severity = 3,
  county = NULL,
  lat = NULL,
  long = NULL,
  dist = NULL
)

Arguments

min_severity

Return only warnings which at least as severe as this level.

county

Return only warnings applying to flood areas whose county name contains the submitted string. Can be a list of county names separated by "," in which case alerts which mention any of the named counties will be returned.

lat, long, dist

Return only warnings applying to flood areas which are within dist km of the given latitude/longitude (in WGS84 coordinates), this may be approximated by a bounding box.

Details

A warning may be at one of four possible severity levels:

1

Severe Flood Warning - Severe Flooding, Danger to Life.

2

Flood Warning - Flooding is Expected, Immediate Action Required.

3

Flood Alert - Flooding is Possible, Be Prepared.

4

Warning no Longer in Force - The warning is no longer in force.

Value

A data frame of flood warnings from the Environment Agency API.

Each individual warning with have a URI given by the @id field in the data:

http://environment.data.gov.uk/flood-monitoring/id/floods/id

The id section of this URI is taken from the value of the floodAreaID. Therefore the current warning for a flood area (if any warning exists) will always have the same URI. The severity level and the message field may change through the lifetime of the warning. The data for a warning will include the time at which the severity last changed. At some point after a warning is no longer in force it will disappear from the data feed and the URI for that warning will cease to resolve. If no warning is currently in place for that flood area, then attempting to resolve the URI will return a 404 status code. For approximately 24 hours after a warning has been in place for a flood area, the severity level will be set to 4, "Warning no Longer in Force", before the warning response is removed altogether.

For more information about the returned data, see https://environment.data.gov.uk/flood-monitoring/doc/reference#flood-warnings.


DavidASmith/eaflood documentation built on April 5, 2022, 4:29 a.m.