basinmerge: Merges adjoining basins

View source: R/cadtools.R

basinmergeR Documentation

Merges adjoining basins

Description

basinmerge merges adjoining basins if the height differences between the bottom of the basin and the pour point is less than than that specified by boundary.

Usage

basinmerge(dem, basins, boundary)

Arguments

dem

a raster object, two-dimensional array or matrix of elevations.

basins

a raster object, two-dimensional array or matrix with basins numbered as integers as returned by basindelin().

boundary

a single numeric value. Basins seperated by boundaries below this height are merged (should have same units as dtm).

Details

If dem is a raster object, then a raster object is returned. If the differences in height between the pour-point and bottom of the basin is less than that specified by boundary the basin is merged with basin to which water or air would pour.

Value

a raster object, two-dimensional array or matrix with basins numbered as integers.

Examples

library(raster)
basins2 <- basinmerge(dtm100m, basins100m, 1)
par(mfrow=c(1, 2))
plot(basins100m, main = "Basins")
plot(basins2, main = "Merged basins")

ilyamaclean/microclima documentation built on Oct. 31, 2023, 11:41 p.m.