# hydflood The R package **hydflood** is designed to compute flood extents and durations along the German federal waterways Elbe and Rhine. ## Installation **hydflood** is available from CRAN. To install it run: ``` r install.packages("hydflood") ``` To install the latest development version from Github run: ``` r install.packages("devtools") library(devtools) devtools::install_github("bafg-bund/hydflood") ``` ## Usage The package **hydflood** is build around the packages `terra` and `hyd1d`. ``` r # load the package options("hydflood.datadir" = tempdir()) library(hydflood) # import the raster data and create a raster stack x <- hydSpatRaster(filename_dem = "data-raw/raster.dem.tif", filename_csa = "data-raw/raster.csa.tif") # 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) # and plot it plot(fd) ``` ![example plot of a hydflood::flood3() raster product](reference/figures/README-usage-1.png) # Package index ## Functions Functions to compute flood extent, duration and depth - [`flood1()`](https://hydflood.bafg.de/reference/flood1.md) : Function to compute flood extent or flood duration `SpatRaster` along the German federal waterways Elbe and Rhine using the 1d water level algorithm [`hyd1d::waterLevelFlood1()`](https://hyd1d.bafg.de/reference/waterLevelFlood1.html) - [`flood2()`](https://hydflood.bafg.de/reference/flood2.md) : Function to compute flood extent or flood duration `SpatRaster` along the German federal waterways Elbe and Rhine using the 1d water level algorithm [`hyd1d::waterLevelFlood2()`](https://hyd1d.bafg.de/reference/waterLevelFlood2.html) - [`flood3()`](https://hydflood.bafg.de/reference/flood3.md) : 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()`](https://hyd1d.bafg.de/reference/waterLevel.html) and [`hyd1d::waterLevelPegelonline()`](https://hyd1d.bafg.de/reference/waterLevel.html) - [`flood3Points()`](https://hydflood.bafg.de/reference/flood3Points.md) : Function to compute flood duration for point coordinates along the German federal waterways Elbe and Rhine using the 1d water level algorithms [`hyd1d::waterLevel()`](https://hyd1d.bafg.de/reference/waterLevel.html) and [`hyd1d::waterLevelPegelonline()`](https://hyd1d.bafg.de/reference/waterLevel.html) - [`hydSpatRaster()`](https://hydflood.bafg.de/reference/hydSpatRaster.md) : Initialize a `SpatRaster` for the flood-functions - [`waterDepth()`](https://hydflood.bafg.de/reference/waterDepth.md) : Function to compute water depths `SpatRaster` for characteristic water levels or selected dates ## Postprocessing Functions to postprocess flood durations - [`df.pnv`](https://hydflood.bafg.de/reference/df.pnv.md) : Reference `data.frame` used to classify flood duration into potential natural vegetation. - [`classifyToPNV()`](https://hydflood.bafg.de/reference/classifyToPNV.md) : Function to reclassify flood durations to potential natural vegetation ## Datasets Spatial datasets included in hydflood - [`sf.af()`](https://hydflood.bafg.de/reference/sf.af.md) : Obtain projected versions of `sf.afe` and `sf.afr` - [`sf.afe`](https://hydflood.bafg.de/reference/sf.afe.md) : Active floodplain along the River Elbe - [`sf.afr`](https://hydflood.bafg.de/reference/sf.afr.md) : Active floodplain along the River Rhine - [`sf.tiles()`](https://hydflood.bafg.de/reference/sf.tiles.md) : Obtain projected versions of `sf.tiles_elbe` and `sf.tiles_rhine` - [`sf.tiles_elbe`](https://hydflood.bafg.de/reference/sf.tiles_elbe.md) : Tiling along the active floodplain of the River Elbe - [`sf.tiles_rhine`](https://hydflood.bafg.de/reference/sf.tiles_rhine.md) : Tiling along the active floodplain of the River Rhine ## Utility functions Utility functions to prepare and store data - [`createTiles()`](https://hydflood.bafg.de/reference/createTiles.md) : Function to split large areas (`sfc_POLYGON`) into tiles - [`getDEM()`](https://hydflood.bafg.de/reference/getDEM.md) : Function to obtain the digital elevation models for the active floodplains along the German federal waterways Elbe and Rhine - [`w80ToSFL()`](https://hydflood.bafg.de/reference/w80ToSFL.md) : Function to convert w80-files to `sfc_LINESTRING`. - [`w80ToSFP()`](https://hydflood.bafg.de/reference/w80ToSFP.md) : Function to convert w80-files to `sfc_POINT`. # Articles ### All vignettes - [hydflood - Vignette](https://hydflood.bafg.de/articles/hydflood.md): - [hydflood - map](https://hydflood.bafg.de/articles/map.md):