An R-package allowing seamless extraction of river networks from Digital Elevation Models data.
elevatr
package). traudem
package). OCNet
package, and can be plotted and analyzed accordingly (and are thus also compatible with packages igraph
and SSN
). For further details, please see Carraro (2023). Technical note: Seamless extraction and analysis of river networks in R. Hydrology and Earth System Sciences. https://doi.org/10.5194/hess-27-3733-2023.
Extract the river Wigger (Switzerland) from an externally provided DEM raster file. Outlet coordinates are in the CH1903/LV03 projected coordinate system (i.e., the same as the DEM file):
fp <- system.file("extdata/wigger.tif", package = "rivnet")
r <- extract_river(outlet = c(637478, 237413),
DEM = fp)
The same result can be obtained by downloading DEM data via elevatr
:
r <- extract_river(outlet = c(637478, 237413),
EPSG = 21781, #CH1903/LV03 coordinate system
ext = c(6.2e5, 6.6e5, 2e5, 2.5e5),
z = 8)
rivnet
depends on traudem
, whose installation might require some caution depending on your operating system. Please read its documentation carefully.
Luca Carraro (maintainer)