Uses gridded elevation data to calculate slope and aspect, by default using a 3x3 region. The horizontal resolution and vertical resolution must be in the same units.
slopeasp(x, EWres, NSres, EWkernel, NSkernel, smoothing=1)
The slope of the DEM, in degrees
The aspect of the DEM, beginning with north and moving clockwise, and with aspect = 0 where slope = 0.
gridded elevation data, either as a SpatialGridDataFrame, dataframe, or matrix.
East-West grid resolution. May be omitted if x is a SpatialGridDataFrame and the horizontal units are the same as the vertical units.
North-South grid resolution. May be omitted if x is a SpatialGridDataFrame and the horizontal units are the same as the vertical units.
The kernel to use when calculating the East-West component of slope. If missing, a 3x3 kernel will be used.
The kernel to use when calculating the North-South component of slope. If missing, a 3x3 kernel will be used.
A positive integer describing the additional smoothing to be applied, if any. smoothing=1 (default) means no smoothing will be used.
Sarah Goslee
By default, a 3x3 Sobel filter is used (as is standard in many GIS packages). A larger Sobel filter or a different filter will give varying results. This filter provides the third-order finite difference weighted by reciprocal of distance method proposed by Unwin (1981).
Unwin, D. 1981. Introductory Spatial Analysis. London: Methuen. Clarke, K.C.and Lee, S.J. 2007. Spatial resolution and algorithm choice as modifiers of downslope flow computed from Digital Elevation Models. Cartography and Geographic Information Science 34:215-230.
movingwindow
, topocorr
data(dem)
dem.slopeasp <- slopeasp(dem)
par(mfrow=c(1,3))
image(dem)
image(dem.slopeasp$slope)
image(dem.slopeasp$aspect)
Run the code above in your browser using DataLab