Title: | Flood Extents and Duration 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 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>. |
Authors: | Arnd Weber [aut, cre]
|
Maintainer: | Arnd Weber <[email protected]> |
License: | GPL-2 |
Version: | 0.5.10 |
Built: | 2025-02-27 14:26:52 UTC |
Source: | CRAN |
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
.
classifyToPNV(x, rcl = NULL, filename = "", ...)
classifyToPNV(x, rcl = NULL, filename = "", ...)
x |
argument of type |
rcl |
optional argument of type |
filename |
supplies an optional output filename of type
|
... |
additional arguments as for |
SpatRaster
object containing potential natural
vegetation distribution as categorical raster.
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.
# 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) }
# 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) }
sfc_POLYGON
) into
tilesTo simplify and accelerate the computation of flood duration
with flood3
in massive areas this function provides a simple
tiling algorithm.
createTiles(x, size_x, size_y, subset = TRUE)
createTiles(x, size_x, size_y, subset = TRUE)
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 |
|
sf
object containing tiles covering x
.
options("hydflood.datadir" = tempdir()) library(hydflood) tiles <- createTiles(x = sf.af(name = "Elbe"), size_x = 10000, size_y = 10000) plot(tiles["tile_ID"])
options("hydflood.datadir" = tempdir()) library(hydflood) tiles <- createTiles(x = sf.af(name = "Elbe"), size_x = 10000, size_y = 10000) plot(tiles["tile_ID"])
data.frame
used to classify flood duration into
potential natural vegetation.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).
df.pnv
df.pnv
A data.frame
containing 7 columns with attributes to
reclassify flood duration into potential natural vegetation.
lower limits of flood duration (included, type numeric
).
upper limits of flood duration (not included, type numeric
).
numeric replacements used to sort classes (type numeric
).
names of the potential natural vegetation classes (type character
).
numeric coding for the r (red) of an rgb color code.
numeric coding for the g (green) of an rgb color code.
numeric coding for the b (blue) of an rgb color code.
html color coding (type character
).
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.
SpatRaster
along the German federal waterways Elbe and Rhine using the 1d water level
algorithm hyd1d::waterLevelFlood1()
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'.
flood1(x, seq, gauging_station, uuid, filename = "", ...)
flood1(x, seq, gauging_station, uuid, filename = "", ...)
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 |
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.
SpatRaster
object with flood duration in the range of
[0, length(seq)]
.
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.
df.gauging_data
,
getGaugingDataW
,
waterLevelFlood1
,
writeRaster
,
terraOptions
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")
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")
SpatRaster
along the German federal waterways Elbe and Rhine using the 1d water level
algorithm hyd1d::waterLevelFlood2()
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'.
flood2(x, seq, filename = "", ...)
flood2(x, seq, filename = "", ...)
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 |
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.
SpatRaster
object with flood duration in the range of
[0, length(seq)]
.
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.
df.gauging_data
,
getGaugingDataW
,
waterLevelFlood2
,
writeRaster
,
terraOptions
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)
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)
SpatRaster
along the German federal waterways Elbe and Rhine using the 1d water level
algorithms hyd1d::waterLevel()
and hyd1d::waterLevelPegelonline()
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.
flood3(x, seq, filename = "", ...)
flood3(x, seq, filename = "", ...)
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 |
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.
SpatRaster
object with flood duration in the range of
[0, length(seq)]
.
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.
waterLevel
,
waterLevelPegelonline
,
writeRaster
,
terraOptions
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)
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)
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)
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()) 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)
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)
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.
getDEM(filename = "", ext, crs, ...)
getDEM(filename = "", ext, crs, ...)
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 |
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")
.
SpatRaster
object containing elevation data for the selected
floodplain region.
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.
options("hydflood.datadir" = tempdir()) options("timeout" = 200) library(hydflood) dem <- getDEM(ext = ext(c(309000, 310000, 5749000, 5750000)), crs = st_crs("EPSG:25833"))
options("hydflood.datadir" = tempdir()) options("timeout" = 200) library(hydflood) dem <- getDEM(ext = ext(c(309000, 310000, 5749000, 5750000)), crs = st_crs("EPSG:25833"))
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.
Maintainer: Arnd Weber [email protected] (ORCID)
Other contributors:
Stephan Rosenzweig [email protected] [contributor]
Benjamin Eberhardt [email protected] [contributor]
Useful links:
Report bugs at https://github.com/bafg-bund/hydflood/issues/
SpatRaster
for the flood-functionsTo 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
).
hydSpatRaster(filename_dem = "", filename_csa = "", ext, crs, ...)
hydSpatRaster(filename_dem = "", filename_csa = "", ext, crs, ...)
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
|
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")
.
SpatRaster
object containing digital elevation (dem
)
and cross section area (csa
) raster layers.
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.”
SpatRaster-class
,
rast
, writeRaster
,
flood1
, flood2
, flood3
,
sf.afe
, sf.afr
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
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
sf.afe
and sf.afr
Obtain projected versions of sf.afe
and
sf.afr
sf.af(name = NULL)
sf.af(name = NULL)
name |
either 'Elbe' or 'Rhine'. |
sf
with the projected active floodplain
library(hydflood) sf.af(name = "Elbe")
library(hydflood) sf.af(name = "Elbe")
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.
sf.afe
sf.afe
A sf
containing 1 polygon
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.
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.
sf.afr
sf.afr
A sf
containing 1 polygon
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.
sf.tiles_elbe
and
sf.tiles_rhine
Obtain projected versions of sf.tiles_elbe
and
sf.tiles_rhine
sf.tiles(name = NULL)
sf.tiles(name = NULL)
name |
either 'Elbe' or 'Rhine'. |
sf
with projected tiles
library(hydflood) sf.tiles(name = "Elbe")
library(hydflood) sf.tiles(name = "Elbe")
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).
sf.tiles_elbe
sf.tiles_elbe
A sf
containing 49 polygons with 18 attributes:
of the tile (type integer
).
of the tile (type character
).
of the tile (type character
) in this case 'ELBE'.
of the tile (type character
).
river kilometer of the tiles upper limit (type numeric
).
river kilometer of the tiles lower limit (type numeric
).
name of the tiles upper gauging station (type character
).
name of the tiles lower gauging station (type character
).
sfc_POLYGON
column storing the geometries.
of the tile extent (type integer
). Minimum of UTM Easting (m).
of the tile extent (type integer
). Maximum of UTM Easting (m).
of the tile extent (type integer
). Minimum of UTM Northing (m).
of the tile extent (type integer
). Maximum of UTM Northing (m).
of the tile extent (type numeric
). Minimum of Longitude (decimal °).
of the tile extent (type numeric
). Maximum of Longitude (decimal °).
of the tile extent (type numeric
). Minimum of Latitude (decimal °).
of the tile extent (type numeric
). Maximum of Latitude (decimal °).
of the tile (type character
).
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.
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).
sf.tiles_rhine
sf.tiles_rhine
A sf
containing 40 polygons with 18 attributes:
of the tile (type integer
).
of the tile (type character
).
of the tile (type character
) in this case RHINE'.
of the tile (type character
).
river kilometer of the tiles upper limit (type numeric
).
river kilometer of the tiles lower limit (type numeric
).
name of the tiles upper gauging station (type character
).
name of the tiles lower gauging station (type character
).
sfc_POLYGON
column storing the geometries.
of the tile extent (type integer
). Minimum of UTM Easting (m).
of the tile extent (type integer
). Maximum of UTM Easting (m).
of the tile extent (type integer
). Minimum of UTM Northing (m).
of the tile extent (type integer
). Maximum of UTM Northing (m).
of the tile extent (type numeric
). Minimum of Longitude (decimal °).
of the tile extent (type numeric
). Maximum of Longitude (decimal °).
of the tile extent (type numeric
). Minimum of Latitude (decimal °).
of the tile extent (type numeric
). Maximum of Latitude (decimal °).
of the tile (type character
).
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.
sfc_LINESTRING
.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
.
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") )
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") )
filename |
argument of length 1 and type |
crs |
|
id |
argument of type |
sfc_LINESTRING
.
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")
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")
sfc_POINT
.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 |
w80ToSFP(filename, crs)
w80ToSFP(filename, crs)
filename |
argument of length 1 and type |
crs |
sfc_POINT
.
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)
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)
SpatRaster
for characteristic
water levels or selected datesComputes 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.
waterDepth(x, value = NULL, df = NULL, filename = "", ...)
waterDepth(x, value = NULL, df = NULL, filename = "", ...)
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 |
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.
SpatRaster
object with a numeric
water depth.
waterLevel
,
waterLevelPegelonline
,
waterLevelFlood2
,
waterLevelFlys3
,
writeRaster
, terraOptions
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)
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)