basinmerge: Merges adjoining basins

Description Usage Arguments Details Value Examples

View source: R/cadtools.R

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

1
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

1
2
3
4
5
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 Dec. 7, 2018, 8:57 a.m.