powered by
delineate the area covered by a catchment from a SpatRaster with flow direction and a pour-point (catchment outlet).
# S4 method for SpatRaster watershed(x, pourpoint, filename="",...)
SpatRaster
SpatRaster with flow direction. See terrain.
terrain
matrix or SpatVector with the pour point location
character. Output filename
additional arguments for writing files as in writeRaster
writeRaster
Ezio Crestaz, Emanuele Cordano, Roman Seliger
elev <- rast(system.file('ex/elev_vinschgau.tif', package="terra")) flowdir <- terrain(elev, "flowdir") ## pour point at Naturns pp <- cbind(653358.3, 5168222) w <- watershed(flowdir, pp)
Run the code above in your browser using DataLab