lucarraro / rivnet

An R-package allowing seamless extraction of river networks from Digital Elevation Models data
https://lucarraro.github.io/rivnet/
Other
13 stars 1 forks source link

rivnet

CRAN

An R-package allowing seamless extraction of river networks from Digital Elevation Models data.

What this package does

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.

A minimal working example

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)

Installation issues

rivnet depends on traudem, whose installation might require some caution depending on your operating system. Please read its documentation carefully.

Author

Luca Carraro (maintainer)