Type: | Package |
Title: | Flood Extents and Duration along the Rivers Elbe and Rhine |
Version: | 0.5.10 |
Date: | 2025-02-26 |
Description: | Raster based flood modelling internally using 'hyd1d', an R package to interpolate 1d water level and gauging data. The package computes flood extent and duration through strategies originally developed for 'INFORM', an 'ArcGIS'-based hydro-ecological modelling framework. It does not provide a full, physical hydraulic modelling algorithm, but a simplified, near real time 'GIS' approach for flood extent and duration modelling. Computationally demanding annual flood durations have been computed already and data products were published by Weber (2022) <doi:10.1594/PANGAEA.948042>. |
Depends: | R (≥ 4.1.0), sf, terra, raster, hyd1d |
Imports: | stats, Rdpack, grDevices, httr2, curl |
Suggests: | knitr, rmarkdown, devtools, pkgdown, roxygen2, testthat, plot3D, shiny, shinyjs, shiny.i18n, leaflet, leaflet.extras, leaflet.esri, pangaear, rgrass, stringr |
RdMacros: | Rdpack |
License: | GPL-2 |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 7.3.2 |
Collate: | 'classifyToPNV.R' 'createTiles.R' 'data.R' 'flood1.R' 'flood2.R' 'flood3.R' 'flood3Points.R' 'getDEM.R' 'hydflood.R' 'hydflood-internal.R' 'hydSpatRaster.R' 'w80ToSpatial.R' 'waterDepth.R' 'zzz.R' |
VignetteBuilder: | knitr |
BugReports: | https://github.com/bafg-bund/hydflood/issues/ |
URL: | https://hydflood.bafg.de, https://github.com/bafg-bund/hydflood |
NeedsCompilation: | no |
Packaged: | 2025-02-27 09:18:01 UTC; WeberA |
Author: | Arnd Weber |
Maintainer: | Arnd Weber <arnd.weber@bafg.de> |
Repository: | CRAN |
Date/Publication: | 2025-02-27 10:20:02 UTC |
hydflood: Flood Extents and Durations along the Rivers Elbe and Rhine
Description
Raster based flood modelling internally using hyd1d, an R package to interpolate 1d water level and gauging data. The package computes flood extent and durations through strategies originally developed for 'INFORM', an 'ArcGIS'-based hydro-ecological modelling framework. It does not provide a full, physical hydraulic modelling algorithm, but a simplified, near real time 'GIS' approach for flood extent and duration modelling. Computationally demanding annual flood durations have been computed already and data products were published by Weber (2022) doi:10.1594/PANGAEA.948042.
Author(s)
Maintainer: Arnd Weber arnd.weber@bafg.de (ORCID)
Other contributors:
Stephan Rosenzweig rosenzweig@bafg.de [contributor]
Benjamin Eberhardt eberhardt@bafg.de [contributor]
See Also
Useful links:
Report bugs at https://github.com/bafg-bund/hydflood/issues/
Function to reclassify flood durations to potential natural vegetation
Description
This function is a wrapper to the function
classify
to convert flood durations computed with
flood3
into potential natural vegetation (PNV) distributions using
reclassification rules supplied with df.pnv
. Alternative
reclassification rules may be applied, but they must match column names and
types as given by df.pnv
. classify
is
called with include.lowest = TRUE
and right = FALSE
.
Usage
classifyToPNV(x, rcl = NULL, filename = "", ...)
Arguments
x |
argument of type |
rcl |
optional argument of type |
filename |
supplies an optional output filename of type
|
... |
additional arguments as for |
Value
SpatRaster
object containing potential natural
vegetation distribution as categorical raster.
References
Ochs K, Egger G, Weber A, Ferreira T, Householder JE, Schneider M (2020). “The potential natural vegetation of large river floodplains – From dynamic to static equilibrium.” Journal of Hydro-environment Research, 30, 71-81. doi:10.1016/j.jher.2020.01.005.
See Also
Examples
# deactivated, since it's very time-consuming
if (FALSE) {
cache <- tempdir()
options("hyd1d.datadir" = cache)
options("hydflood.datadir" = cache)
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-01-01"), as.Date("2016-12-31"), by = "day")
# compute a flood duration
fd <- flood3(x = x, seq = seq)
# reclassify to PNV
pnv <- classifyToPNV(fd)
# plot pnv map
plot(pnv)
}
Function to split large areas (sfc_POLYGON
) into
tiles
Description
To simplify and accelerate the computation of flood duration
with flood3
in massive areas this function provides a simple
tiling algorithm.
Usage
createTiles(x, size_x, size_y, subset = TRUE)
Arguments
x |
has to by type |
size_x |
tile size along the x-axis in the units of the current projection ( |
size_y |
tile size along the y-axis in the units of the current projection ( |
subset |
|
Value
sf
object containing tiles covering x
.
Examples
options("hydflood.datadir" = tempdir())
library(hydflood)
tiles <- createTiles(x = sf.af(name = "Elbe"),
size_x = 10000, size_y = 10000)
plot(tiles["tile_ID"])
Reference data.frame
used to classify flood duration into
potential natural vegetation.
Description
Reference data.frame
used to classify flood duration into
potential natural vegetation (PNV). It is an extended and more detailled
table to reclassify flood duration into PNV based on Ochs et al. (2020).
Usage
df.pnv
Format
A data.frame
containing 7 columns with attributes to
reclassify flood duration into potential natural vegetation.
- from
lower limits of flood duration (included, type
numeric
).- to
upper limits of flood duration (not included, type
numeric
).- id
numeric replacements used to sort classes (type
numeric
).- vegtype
names of the potential natural vegetation classes (type
character
).- r
numeric coding for the r (red) of an rgb color code.
- g
numeric coding for the g (green) of an rgb color code.
- b
numeric coding for the b (blue) of an rgb color code.
- html
html color coding (type
character
).
References
Ochs K, Egger G, Weber A, Ferreira T, Householder JE, Schneider M (2020). “The potential natural vegetation of large river floodplains – From dynamic to static equilibrium.” Journal of Hydro-environment Research, 30, 71-81. doi:10.1016/j.jher.2020.01.005.
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()
Description
Computes 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
waterLevelFlood1
provided by package hyd1d in
analogy to the INFORM 3 module 'Flut1'.
Usage
flood1(x, seq, gauging_station, uuid, filename = "", ...)
Arguments
x |
has to be type |
seq |
has to be type |
gauging_station |
has to be type |
uuid |
has to be type |
filename |
supplies an optional output filename and has to be type
|
... |
additional arguments as for |
Details
For every time step provided in seq
, flood1()
computes
a 1d water level using waterLevelFlood1
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.
Value
SpatRaster
object with flood duration in the range of
[0, length(seq)]
.
References
Rosenzweig S, Giebel H, Schleuter M (2011). “Ökologische Modellierungen für die Wasser- und Schifffahrtsverwaltung – Das integrierte Flussauenmodell INFORM in seiner neuesten Fassung (Version 3). Bundesanstalt für Gewässerkunde, Koblenz, Germany.” doi:10.5675/bfg-1667.
See Also
df.gauging_data
,
getGaugingDataW
,
waterLevelFlood1
,
writeRaster
,
terraOptions
Examples
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 <- flood1(x = x, seq = seq, gauging_station = "ROSSLAU")
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()
Description
Computes 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
waterLevelFlood2
provided by package hyd1d in
analogy to the INFORM 3 module 'Flut2'.
Usage
flood2(x, seq, filename = "", ...)
Arguments
x |
has to by type |
seq |
has to be type |
filename |
supplies an optional output filename and has to be type
|
... |
additional arguments as for |
Details
For every time step provided in seq
, flood2()
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
, layer flood duration is increased by 1.
Value
SpatRaster
object with flood duration in the range of
[0, length(seq)]
.
References
Rosenzweig S, Giebel H, Schleuter M (2011). “Ökologische Modellierungen für die Wasser- und Schifffahrtsverwaltung – Das integrierte Flussauenmodell INFORM in seiner neuesten Fassung (Version 3). Bundesanstalt für Gewässerkunde, Koblenz, Germany.” doi:10.5675/bfg-1667.
See Also
df.gauging_data
,
getGaugingDataW
,
waterLevelFlood2
,
writeRaster
,
terraOptions
Examples
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 <- flood2(x = x, seq = seq)
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()
Description
Computes 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.
Usage
flood3(x, seq, filename = "", ...)
Arguments
x |
has to by type |
seq |
has to be type |
filename |
supplies an optional output filename and has to be type
|
... |
additional arguments as for |
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.
Value
SpatRaster
object with flood duration in the range of
[0, length(seq)]
.
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.
See Also
waterLevel
,
waterLevelPegelonline
,
writeRaster
,
terraOptions
Examples
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)
Function to compute flood duration for point coordinates along the
German federal waterways Elbe and Rhine using the 1d water level algorithms
hyd1d::waterLevel()
and hyd1d::waterLevelPegelonline()
Description
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.
Usage
flood3Points(x, seq)
Arguments
x |
has to by type |
seq |
has to be type |
Details
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.
Value
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
.
See Also
waterLevel
,
waterLevelPegelonline
Examples
options("hydflood.datadir" = tempdir())
options("timeout" = 200)
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)
Function to obtain the digital elevation models for the active floodplains along the German federal waterways Elbe and Rhine
Description
This function downloads and patches the tiled digital elevation models (dem) along the German federal waterways Elbe and Rhine that have been published on pangaea.de.
Usage
getDEM(filename = "", ext, crs, ...)
Arguments
filename |
supplies an optional in- and output filename and has to be
type |
ext |
argument of type |
crs |
argument of type |
... |
additional arguments as for |
Details
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.
Since downloads of large individual datasets might cause timeouts, it is
recommended to increase options("timeout")
.
Value
SpatRaster
object containing elevation data for the selected
floodplain region.
References
Weber A (2020). “Digital elevation models of German waterway and navigation authorities - Version 0.1.0.” https://doi.org/10.5675/BfG-2011.
Weber A (2020). “Digital elevation model (DEM1) of the River Elbe floodplain between Schmilka and Geesthacht, Germany.” https://doi.org/10.1594/PANGAEA.919293.
Weber A (2020). “Digital elevation model (DEM1) of the River Rhine floodplain between Iffezheim and Kleve, Germany.” https://doi.org/10.1594/PANGAEA.919308.
Examples
options("hydflood.datadir" = tempdir())
options("timeout" = 200)
library(hydflood)
dem <- getDEM(ext = ext(c(309000, 310000, 5749000, 5750000)),
crs = st_crs("EPSG:25833"))
Initialize a SpatRaster
for the flood-functions
Description
To initialize an object of class SpatRaster
with layers dem and csa this function should be used. It checks all the
required input data, downloads missing data automatically, clips and
returns the final object, prepared for the flood()
functions
(flood1
, flood2
and flood3
).
Usage
hydSpatRaster(filename_dem = "", filename_csa = "", ext, crs, ...)
Arguments
filename_dem |
an optional argument of length 1 with type
If the file exists it is imported via An existing dataset must be either in the coordinate reference system (crs)
'ETRS 1989 UTM 32N' (epsg: 25832) for the River Rhine or 'ETRS 1989 UTM 33N'
(epsg: 25833) for the River Elbe. It must also overlap with the active
floodplains ( If argument Supported file types depend on available GDAL raster drivers. |
filename_csa |
an optional argument of length 1 with type
If the file exists it is imported via An existing dataset must be either in the coordinate reference system (crs)
'ETRS 1989 UTM 32N' (epsg: 25832) for the River Rhine or 'ETRS 1989 UTM 33N'
(epsg: 25833) for the River Elbe. It must also overlap with the active
floodplains ( If argument Supported file types depend on available GDAL raster drivers. |
ext |
optional argument of type |
crs |
optional argument of type |
... |
additional parameters passed to
|
Details
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.
Since downloads of large individual datasets might cause timeouts, it is
recommended to increase options("timeout")
.
Value
SpatRaster
object containing digital elevation (dem
)
and cross section area (csa
) raster layers.
References
Wasserstraßen- und Schifffahrtsverwaltung des Bundes (WSV) (2016). “Digitales Geländemodell des Wasserlaufs (DGM-W).” https://www.govdata.de/daten/-/details/1c669080-c804-11e4-8731-1681e6b88ec1.
Brockmann H, Großkordt U, Schumann L (2008). “Auswertung digitaler Fernerkundungsaufnahmen des Elbe-Wasserlaufes (FE-Datenauswertung Elbe).”
Brockmann H, Schumann L (2012). “Produktblatt: DGM-W Elbe-Lenzen, 2003-2011.”
Brockmann H, Großkordt U, Schumann L (2008). “Digitales Geländemodell des Rhein-Wasserlaufes von Iffezheim bis Bonn (DGM-W Rhein).”
smile consult GmbH & Inphoris GmbH (2011). “DGM-W Oberrhein 1.”
FUGRO-HGN GmbH (2011). “Aufbau eines Digitalen Geländemodells des Oberrheinwasserverlaufes (DGM-W Oberrhein-2, Basel bis Iffezheim).”
ARGE Vermessung Schmid - Inphoris (2012). “Aufbau eines Digitalen Geländemodells des Niederrheinwasserlaufes (DGM-W Niederrhein).”
Weber A (2020). “Digital elevation models of German waterway and navigation authorities - Version 0.1.0.” https://doi.org/10.5675/BfG-2011.
Weber A (2020). “Digital elevation model (DEM1) of the River Elbe floodplain between Schmilka and Geesthacht, Germany.” https://doi.org/10.1594/PANGAEA.919293.
Weber A (2020). “Digital elevation model (DEM1) of the River Rhine floodplain between Iffezheim and Kleve, Germany.” https://doi.org/10.1594/PANGAEA.919308.
Bundesanstalt für Gewässerkunde (2016). “FLYS – Flusshydrologischer Webdienst.” https://www.bafg.de/DE/5_Informiert/1_Portale_Dienste/FLYS/flys_node.html.
Brunotte E, Dister E, Günther-Diringer D, Koenzen U, Mehl D (2009). “Zustand der rezenten Flussauen in Deutschland - Geodaten.”
See Also
SpatRaster-class
,
rast
, writeRaster
,
flood1
, flood2
, flood3
,
sf.afe
, sf.afr
Examples
options("hydflood.datadir" = tempdir())
options("timeout" = 200)
library(hydflood)
e <- ext(436500, 438000, 5415000, 5416500)
c <- st_crs("EPSG:25832")
r <- hydSpatRaster(ext = e, crs = c)
r
Obtain projected versions of sf.afe
and sf.afr
Description
Obtain projected versions of sf.afe
and
sf.afr
Usage
sf.af(name = NULL)
Arguments
name |
either 'Elbe' or 'Rhine'. |
Value
sf
with the projected active floodplain
See Also
Examples
library(hydflood)
sf.af(name = "Elbe")
Active floodplain along the River Elbe
Description
This dataset contains a polygon of the active floodplain along the German interior parts of the River Elbe from the Czech border to the weir in Geesthacht in the coordinate reference system ETRS 1989 UTM 33N.
Originally, this polygon was produced for the floodplain status report (Auenzustandsbericht; Brunotte et al. (2009), Bundesamt für Naturschutz (2009)) at a scale of 1:25,000. For hydflood it was updated with recent flood protection measures and manually improved with recent digital elevation models and aerial images at a scale of < 1:10,000.
Usage
sf.afe
Format
A sf
containing 1 polygon
References
Brunotte E, Dister E, Günther-Diringer D, Koenzen U, Mehl D (2009). “Flussauen in Deutschland - Erfassung und Beurteilung des Auenzustandes.”
Brunotte E, Dister E, Günther-Diringer D, Koenzen U, Mehl D (2009). “Zustand der rezenten Flussauen in Deutschland - Geodaten.”
Bundesamt für Naturschutz (2009). “Zustand der rezenten Flussauen in Deutschland.” https://www.bfn.de/sites/default/files/2023-01/Auenzustandsbericht%202009_0.pdf.
See Also
Active floodplain along the River Rhine
Description
This dataset contains a polygon of the active floodplain along the German, freeflowing parts of the River Rhine from the weir Iffezheim to the Dutch border in the coordinate reference system ETRS 1989 UTM 32N.
Originally, this polygon was produced for the floodplain status report (Auenzustandsbericht; Brunotte et al. (2009), Bundesamt für Naturschutz (2009)) at a scale of 1:25,000. For hydflood it was updated with recent flood protection measures and manually improved with recent digital elevation models and aerial images at a scale of < 1:10,000.
Usage
sf.afr
Format
A sf
containing 1 polygon
References
Brunotte E, Dister E, Günther-Diringer D, Koenzen U, Mehl D (2009). “Flussauen in Deutschland - Erfassung und Beurteilung des Auenzustandes.”
Brunotte E, Dister E, Günther-Diringer D, Koenzen U, Mehl D (2009). “Zustand der rezenten Flussauen in Deutschland - Geodaten.”
Bundesamt für Naturschutz (2009). “Zustand der rezenten Flussauen in Deutschland.” https://www.bfn.de/sites/default/files/2023-01/Auenzustandsbericht%202009_0.pdf.
See Also
Obtain projected versions of sf.tiles_elbe
and
sf.tiles_rhine
Description
Obtain projected versions of sf.tiles_elbe
and
sf.tiles_rhine
Usage
sf.tiles(name = NULL)
Arguments
name |
either 'Elbe' or 'Rhine'. |
Value
sf
with projected tiles
See Also
Examples
library(hydflood)
sf.tiles(name = "Elbe")
Tiling along the active floodplain of the River Elbe
Description
This dataset contains 49 rectangular polygons / tiles along the active floodplain along the German interior parts of the River Elbe from the Czech border to the weir in Geesthacht in the coordinate reference system ETRS 1989 UTM 33N.
The tiles represent the original tiling of the internally used digital elevation model (Weber 2020).
Usage
sf.tiles_elbe
Format
A sf
containing 49 polygons with 18 attributes:
- id
of the tile (type
integer
).- name
of the tile (type
character
).- river
of the tile (type
character
) in this case 'ELBE'.- name_km
of the tile (type
character
).- from_km
river kilometer of the tiles upper limit (type
numeric
).- to_km
river kilometer of the tiles lower limit (type
numeric
).- gs_upper
name of the tiles upper gauging station (type
character
).- gs_lower
name of the tiles lower gauging station (type
character
).- geometry
sfc_POLYGON
column storing the geometries.- xmin
of the tile extent (type
integer
). Minimum of UTM Easting (m).- xmax
of the tile extent (type
integer
). Maximum of UTM Easting (m).- ymin
of the tile extent (type
integer
). Minimum of UTM Northing (m).- ymax
of the tile extent (type
integer
). Maximum of UTM Northing (m).- lon_min
of the tile extent (type
numeric
). Minimum of Longitude (decimal °).- lon_max
of the tile extent (type
numeric
). Maximum of Longitude (decimal °).- lat_min
of the tile extent (type
numeric
). Minimum of Latitude (decimal °).- lat_max
of the tile extent (type
numeric
). Maximum of Latitude (decimal °).- url
of the tile (type
character
).
References
Weber A (2020). “Digital elevation models of German waterway and navigation authorities - Version 0.1.0.” https://doi.org/10.5675/BfG-2011.
Weber A (2020). “Digital elevation model (DEM1) of the River Elbe floodplain between Schmilka and Geesthacht, Germany.” https://doi.org/10.1594/PANGAEA.919293.
See Also
Tiling along the active floodplain of the River Rhine
Description
This dataset contains 40 rectangular polygons / tiles along the active floodplain along the German, freeflowing parts of the River Rhine from the weir Iffezheim to the Dutch border near Kleve in the coordinate reference system ETRS 1989 UTM 32N.
The tiles represent the original tiling of the internally used digital elevation model (Weber 2020).
Usage
sf.tiles_rhine
Format
A sf
containing 40 polygons with 18 attributes:
- id
of the tile (type
integer
).- name
of the tile (type
character
).- river
of the tile (type
character
) in this case RHINE'.- name_km
of the tile (type
character
).- from_km
river kilometer of the tiles upper limit (type
numeric
).- to_km
river kilometer of the tiles lower limit (type
numeric
).- gs_upper
name of the tiles upper gauging station (type
character
).- gs_lower
name of the tiles lower gauging station (type
character
).- geometry
sfc_POLYGON
column storing the geometries.- xmin
of the tile extent (type
integer
). Minimum of UTM Easting (m).- xmax
of the tile extent (type
integer
). Maximum of UTM Easting (m).- ymin
of the tile extent (type
integer
). Minimum of UTM Northing (m).- ymax
of the tile extent (type
integer
). Maximum of UTM Northing (m).- lon_min
of the tile extent (type
numeric
). Minimum of Longitude (decimal °).- lon_max
of the tile extent (type
numeric
). Maximum of Longitude (decimal °).- lat_min
of the tile extent (type
numeric
). Minimum of Latitude (decimal °).- lat_max
of the tile extent (type
numeric
). Maximum of Latitude (decimal °).- url
of the tile (type
character
).
References
Weber A (2020). “Digital elevation models of German waterway and navigation authorities - Version 0.1.0.” https://doi.org/10.5675/BfG-2011.
Weber A (2020). “Digital elevation model (DEM1) of the River Rhine floodplain between Iffezheim and Kleve, Germany.” https://doi.org/10.1594/PANGAEA.919308.
See Also
Function to convert w80-files to sfc_LINESTRING
.
Description
This function converts w80-files, an ascii-format with 80 characters per line for spatial point data used by the German Waterways and Shipping Administration (WSV). Every single row codes for one point:
|_1_|2_|_3______|4|____________5______________|_______6_______|_____7___|_8_|
W0701 55 2594611 1330938065557502425901108035 5795591108035 Bu.15 01
W0701 57 2594611 7330932961457502484041108035 5538181108035 Bu.15 01
Within each row very specific sections code for specific attributes:
section | column(s) | attribute | column name in result |
1 | 1 | state id, here W=WSV | sid |
1 | 2-5 | Federal Waterway ID | fwid |
2 | 6-8 | WSV point type | wsvpt |
3 | 9 | blank | - |
3 | 10-15 | river station (km) | station |
4 | 16 | bank: 1 left, 2 right | bank |
4 | 17-20 | continuous id | id |
5 | 21-30 | easting in GK-coordinates | x |
5 | 31-40 | northing in GK-coordinates | y |
6 | 41-46 | datum of measurement | date_coor |
6 | 47 | accuracy | acc_coor |
6 | 48-54 | elevation | z |
6 | 55-60 | date of the elevation measurement | date_z |
6 | 61 | accuracy of the elevation measurement | acc_z |
6 | 62-64 | type of measurement | tom |
7 | 65-84 | comment | comment |
8 | 85-86 | point status | status |
In a second step these points are aggregated to a
sfc_LINESTRING
using the grouping column id
.
Usage
w80ToSFL(
filename,
crs,
id = c("sid", "fwid", "wsvpt", "station", "bank", "id", "x", "y", "date_coor",
"acc_coor", "z", "date_z", "acc_z", "tom", "comment", "status", "lat", "lon",
"station_int", "station_c")
)
Arguments
filename |
argument of length 1 and type |
crs |
|
id |
argument of type |
Value
sfc_LINESTRING
.
Examples
options("hydflood.datadir" = tempdir())
library(hydflood)
c <- st_crs("EPSG:25833")
filename <- tempfile(fileext = ".w80")
# write temporary w80 file
cat("W0701 55 2594611 1330938065557502425901108035 5795591108035 Bu.15 01\n",
file = filename)
cat("W0701 57 2594611 7330932961457502484041108035 5538181108035 Bu.15 01\n",
file = filename, append = TRUE)
# import temporary w80 file as sf LINESTRING
sl <- w80ToSFL(filename, c, "station_int")
Function to convert w80-files to sfc_POINT
.
Description
This function converts w80-files, an asci-format with 80 characters per line for spatial point data used by the German Waterways and Shipping Administration (WSV). Every single row codes for one point:
|_1_|2_|_3______|4|____________5______________|_______6_______|_____7___|_8_|
W0701 55 2594611 1330938065557502425901108035 5795591108035 Bu.15 01
W0701 57 2594611 7330932961457502484041108035 5538181108035 Bu.15 01
Within each row very specific sections code for specific attributes:
section | column(s) | attribute | column name in result |
1 | 1 | state id, here W=WSV | sid |
1 | 2-5 | Federal Waterway ID | fwid |
2 | 6-8 | WSV point type | wsvpt |
3 | 9 | blank | - |
3 | 10-15 | river station (km) | station |
4 | 16 | bank: 1 left, 2 right | bank |
4 | 17-20 | continuous id | id |
5 | 21-30 | easting in GK-coordinates | x |
5 | 31-40 | northing in GK-coordinates | y |
6 | 41-46 | datum of measurement | date_coor |
6 | 47 | accuracy | acc_coor |
6 | 48-54 | elevation | z |
6 | 55-60 | date of the elevation measurement | date_z |
6 | 61 | accuracy of the elevation measurement | acc_z |
6 | 62-64 | type of measurement | tom |
7 | 65-84 | comment | comment |
8 | 85-86 | point status | status |
Usage
w80ToSFP(filename, crs)
Arguments
filename |
argument of length 1 and type |
crs |
Value
sfc_POINT
.
Examples
options("hydflood.datadir" = tempdir())
library(hydflood)
c <- st_crs("EPSG:25833")
filename <- tempfile(fileext = ".w80")
# write temporary w80 file
cat("W0701 55 2594611 1330938065557502425901108035 5795591108035 Bu.15 01\n",
file = filename)
cat("W0701 57 2594611 7330932961457502484041108035 5538181108035 Bu.15 01\n",
file = filename, append = TRUE)
# import temporary w80 file as sf POINT
sf <- w80ToSFP(filename, c)
Function to compute water depths SpatRaster
for characteristic
water levels or selected dates
Description
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 |
value |
an optional value of type |
df |
an optional object of type |
filename |
supplies an optional output filename and has to be type
|
... |
additional arguments as for |
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.
Value
SpatRaster
object with a numeric
water depth.
See Also
waterLevel
,
waterLevelPegelonline
,
waterLevelFlood2
,
waterLevelFlys3
,
writeRaster
, terraOptions
Examples
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)