flood3Points {hydflood} | R Documentation |
hyd1d::waterLevel()
and hyd1d::waterLevelPegelonline()
Computes flood duration for points located in 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.
flood3Points(x, seq)
x |
has to by type |
seq |
has to be type |
For every time step provided in seq
, flood3Points()
computes a 1d water level along the requested river section. This 1d water
level is transfered to a temporary wl
(water level) column and then
compared to the dem
(digital elevation model) column. Where the
wl
is higher than the dem
flood duration flood3
is
increased by 1.
Since the underlying tiled digital elevation models (dem) are rather
large datasets hydflood provides options to permanentely cache these
datasets. options("hydflood.datadir" = tempdir())
is the default. To
modify the location of your raster cache to your needs set the respective
options()
prior to loading the package, e.g.
options("hydflood.datadir" = "~/.hydflood");library(hydflood)
. The
location can also be determined through the environmental variable
hydflood_datadir.
sf
object with flood duration stored in column
flood3
in the range of [0, length(seq)]
, elevation stored in
column dem
and cross section areas stored in column csa
.
waterLevel
,
waterLevelPegelonline
options("hydflood.datadir" = tempdir())
library(hydflood)
# create a random points object
c <- st_crs(25833)
e <- st_as_sfc(st_bbox(c(xmin = 309000, xmax = 310000,
ymin = 5749000, ymax = 5750000)))
st_crs(e) <- c
set.seed(123)
points <- st_sample(e, size = 10, "random")
p <- data.frame(id = 1:10)
st_geometry(p) <- points
# create a temporal sequence
seq <- seq(as.Date("2016-12-01"), as.Date("2016-12-31"), by = "day")
# compute a flood duration
p <- flood3Points(x = p, seq = seq)