
Function to compute water depths SpatRaster for characteristic water levels or selected dates
Source: R/waterDepth.R
waterDepth.RdComputes water depths for characteristic water levels or dates
for the active floodplains along the German federal waterways Elbe, Rhine
and the North Sea estuaries based on 1d water levels computed by
waterLevel, waterLevelPegelonline,
waterLevelFlood2 or
waterLevelFlys3 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 and the estuaries in ETRS 1989 UTM 32N. Other coordinate reference systems are not permitted.- value
an optional value of type
c("POSIXct", "POSIXt"),Dateorcharacter. Forc("POSIXct", "POSIXt")orDatevalueswaterLevel- orwaterLevelPegelonline-function are used internally for the water level computation. ForcharactervalueswaterLevelFlood2orwaterLevelFlys3are used internally. Commonly availablecharactervalues arec("MThw", "MTnw", "HThw", "NTnw", "HHW", "NNW", "MNW", "MW", "MHW")or a column supplied indf.- df
an optional object of type
data.frame, which must contain the columnsgauging_station,river,longitude,latitude,km_csa,pnpand finally a water level column named invalue.- filename
supplies an optional output filename and has to be type
character.- ...
additional arguments as for
writeRaster.
Details
For the characteristic water level provided in value (and
df) waterDepth() computes a 1d water
level using waterLevelFlood2 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, the
resulting flood extent layer is set to 1.
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)
# compute the water depth
depth <- waterDepth(x = x, value = "MQ")
# plot the product
plot(depth)
# }