Follow the largest accumulation tributary at confluences when moving upstream This function relies on the following GRASS GIS modules : r.stream.basins (add-on to be installed)

get_basins(st, outlets, gisbase)

Arguments

st

A SpatRaster object from `dem_process`

outlets

Outlets points (SpatVector)

gisbase

The directory path to GRASS binaries and libraries, containing bin and lib sub-directories among others

Value

A SpatVector with the corresponding basins. The attribute table of the outlets vector is transferred.