Skip to contents

Calculates multiscale slope and aspect using a local planar fit (IN DEVELOPMENT: DO NOT USE)

Usage

Pfit(
  r,
  w = c(3, 3),
  unit = "degrees",
  na.rm = FALSE,
  include_scale = FALSE,
  filename = NULL,
  overwrite = FALSE,
  wopt = list()
)

Arguments

r

DTM as a SpatRaster (terra) or RasterLayer (raster) in a projected coordinate system where map units match elevation/depth units (up is assumed to be north for calculations of aspect, northness, and eastness).

w

Vector of length 2 specifying the dimensions of the rectangular window to use where the first number is the number of rows and the second number is the number of columns. Window size must be an odd number. Default is 3x3.

unit

"degrees" or "radians".

na.rm

Logical indicating whether or not to remove NA values before calculations.#'

include_scale

logical indicating whether to append window size to the layer names (default = 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

Value

a SpatRaster (terra) or RasterStack/RasterLayer (raster)

References

Sharpnack, D. A. and Akin, G., 1969. An algorithm for computing slope and aspect from elevations. Photogrammetric Engineering 35(3), 247-248.