Matrix of topographic distances (if paths = FALSE), or a list containing a matrix of topographic distances and the topographic paths as an object of class SpatialLines (if paths = TRUE).
Arguments
DEM
A RasterLayer for digital elevation model (DEM) data.
costSurface
A RasterLayer for the conductance (inverse of resistance) values for each cell.
pts
A SpatialPoints object or two-column matrix with xy coordinates for the geographic points from which to calculate pairwise distances and paths.
directions
numeric (default = 8). The number of directions for movement between cells, either 4 or 8.
paths
logical. Default is FALSE, in which case only topographic distances are calculated. If TRUE, topographic paths are also identified.
zweight
numeric (default = 1). The weight to be applied to the elevation (z) distances relative to the horizontal (xy) distances.
Details
The values of the raster for costSurface should be conductance values rather than resistance values. These can be calculating by taking the inverse of resistance values.