Skip to contents

Get the "centerline" of the longest river along the DEM

Usage

get_river_centerline(dem, quiet = TRUE)

Arguments

dem

Either a SpatRaster (created via terra::rast()) or an object that terra::rast() can read to create a SpatRaster.

quiet

Boolean: should execution proceed "quietly", without messages (TRUE) or should progress updates be posted during centerline download and interpolation (FALSE)?

Value

An sfc object (as created by sf::st_sfc()), with LINESTRING geometry, representing the center of the river within the DEM area.

Examples

if (FALSE) { # rlang::is_interactive()
dem <- system.file("elevation.tiff", package = "rrrem")
centerline <- get_river_centerline(dem)
}