Calculates the slope along a specified direction. Upslope values are positive and downslope values are negative.
Usage
DirSlp(
alpha,
dz.dx,
dz.dy,
unit = "degrees",
abs = FALSE,
include_dir = FALSE,
filename = NULL,
overwrite = FALSE,
wopt = list()
)
Arguments
- alpha
Angle (in specified 'unit') at which you would like to calculate slope. 0 represents up in map direction (usually North) and it increases clockwise. This can be a single number or it can be a raster of cell values.
- dz.dx
The change in elevation per unit distance in the x direction as a SpatRaster, RasterLayer, or a single number. Positive is to the right. See details for more.
- dz.dy
The change in elevation per unit distance in the y direction as a SpatRaster or RasterLayer,or a single number Positive is up. See details for more.
- unit
"degrees" or "radians" (default is "degrees")
- abs
logical indicating whether or not to return the absolute value of slope (default is FALSE)
- include_dir
logical indicating whether to append direction to layer name (default is FALSE)
- filename
character Output filename. Can be a single filename, or as many filenames as there are layers to write a file for each layer
- overwrite
logical. If TRUE, filename is overwritten (default is FALSE).
- wopt
list with named options for writing files as in writeRaster
Details
dz.dx can be calculated at a specified scale via SlpAsp
, Qfit
(zx and zy), or from an existing layer calculated by another program.