Skip to contents

Computes 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.

Usage

waterDepth(x, value = NULL, df = NULL, filename = "", ...)

Arguments

x

has to by type SpatRaster and has to include both input raster layers csa (cross section areas) and dem (digital elevation model). To compute water levels along the River Elbe x has 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"), Date or character. For c("POSIXct", "POSIXt") or Date values waterLevel- or waterLevelPegelonline-function are used internally for the water level computation. For character values waterLevelFlood2 or waterLevelFlys3 are used internally. Commonly available character values are c("MThw", "MTnw", "HThw", "NTnw", "HHW", "NNW", "MNW", "MW", "MHW") or a column supplied in df.

df

an optional object of type data.frame, which must contain the columns gauging_station, river, longitude, latitude, km_csa, pnp and finally a water level column named in value.

filename

supplies an optional output filename and has to be type character.

...

additional arguments as for writeRaster.

Value

SpatRaster object with a numeric water depth.

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)

# }