This algorithm delineates multiple catchments from input point locations and a drainage direction layer. Catchments are delineated upstream from the point given, until another given outlet point is met. The result is a set of catchments which are unique to the outlets given.

delineate_basin(
  outlets,
  drain.dir,
  riverID = "riverID",
  output = "vector",
  use_rsaga = TRUE,
  verbose = FALSE
)

Arguments

outlets

An 'sf' point object, with locations of the catchment outlets for delineation. Obtained e.g. with river_outlets

drain.dir

A RasterLayer object of drainage directions.

riverID

Name of the column in outlets with unique identifiers.

output

Whether to return a raster or vectors of delineated catchments. Accepts "vector", "v", "raster", or "r".

use_rsaga

Whether to try using RSAGA for basin vectorization or not. Even if TRUE, requires RSAGA environment to be installed in the system.

verbose

Whether or not print progress indicators.

Value

If output is vector (default), returns vectorized (polygon) catchments specific to the outlet points given. The output is 'sf' POLYGON class with attributes:

  • riverID: The ID given in outlets.

  • NCELLS: The number of raster cells the catchment consists of.

  • AREA_M2: Surface area of the catchment in m^2.

If output is raster, returns a raster with delineated areas.

Author

Vili Virkki, Marko Kallio

Examples

if (FALSE) { # to be added }