
Function to compute flood extent or flood duration SpatRaster along the German federal waterways Elbe and Rhine using the 1d water level algorithms hyd1d::waterLevel() and hyd1d::waterLevelPegelonline()
Source: R/flood3.R
flood3.RdComputes flood extent, if length(seq) equals 1, or flood
duration for the active floodplains along the German federal waterways Elbe
and Rhine based on 1d water levels computed by
waterLevel or
waterLevelPegelonline provided by package hyd1d.
Arguments
- x
has to by type
SpatRasterand has to include both input raster layerscsa(cross section areas) anddem(digital elevation model). To compute water levels along the River Elbexhas to be in the coordinate reference system ETRS 1989 UTM 33N, for River Rhine in ETRS 1989 UTM 32N. Other coordinate reference systems are not permitted.- seq
has to be type
c("POSIXct", "POSIXt")orDateand have a length larger than 0. Ifseqis typec("POSIXct", "POSIXt"), values must be in the temporal range between 31 days ago (Sys.time() - 2678400) and now (Sys.time()). ThenwaterLevelPegelonlineis used internally for the water level computations. Ifseqis typeDate, values must be in the temporal range between 1960-01-01 and yesterday (Sys.Date() - 1) andwaterLevelis used internally.- filename
supplies an optional output filename and has to be type
character.- ...
additional arguments as for
writeRaster.
Details
For every time step provided in seq, flood3() computes
a 1d water level along the requested river section. This 1d water level is
transfered to a wl (water level) raster layer, which is in fact a
copy of the csa (cross section areas) layer, and then
compared to the dem (digital elevation model) layer. Where the
wl layer is higher than the dem, layer flood duration is
increased by 1.
References
Weber A (2022). “Flood durations and potential natural vegetation distribution on the floodplains of River Rhine and River Elbe, Germany.” doi:10.1594/PANGAEA.948042 .
Weber A (2023). “Flood durations of the year 2022 on the floodplains of River Rhine and River Elbe, Germany.” doi:10.1594/PANGAEA.961117 .
Examples
# \donttest{
options("hydflood.datadir" = tempdir())
options("timeout" = 200)
library(hydflood)
# import the raster data and create a raster stack
c <- st_crs("EPSG:25833")
e <- ext(309000, 310000, 5749000, 5750000)
x <- hydSpatRaster(ext = e, crs = c)
# create a temporal sequence
seq <- seq(as.Date("2016-12-01"), as.Date("2016-12-31"), by = "day")
# compute a flood duration
fd <- flood3(x = x, seq = seq)
# }