Description Usage Arguments Details Value Author(s) References Examples
slope
and aspect
calculates the slope and
aspect of raster surfaces of class 'asc' (SDMTools &
adehabitat packages), 'RasterLayer' (raster package) or
'SpatialGridDataFrame' (sp package).
Methods are
based on Burrough and McDonell (1998).
1 2 3 |
mat |
a matrix of data representing z heights. Matrix can be a raster of class 'asc' (adehabitat package), 'RasterLayer' (raster package) or 'SpatialGridDataFrame' (sp package) |
latlon |
boolean value representing if the data is geographic. |
Slope returns values representing the 'rise over run' with
"run" units representing cellsize if latlon
=FALSE or
km if latlon
=TRUE. This can be changed to percentage
(multiply by 100) or to degrees by ATAN ( output
) *
57.29578.
Aspect returns the direction (0 to 360)
with North being 0. Values of -1 are flat areas with no
slope or aspect.
As this method requires information
from the surrounding cells, missing data (NAs or edges) are
populated with the value from the 'cell-of-interest').
an object of the same class as mat
.
Jeremy VanDerWal jjvanderwal@gmail.com
Burrough, P. A. and McDonell, R.A., 1998. Principles of Geographical Information Systems (Oxford University Press, New York), p. 190.
1 2 3 4 5 6 7 8 9 | #define a simple asc with some slope and direction
tasc = as.asc(matrix(1:50,nr=10,nc=5),yll=75); tasc[,]
slope(tasc)[,] #show the output of slope
aspect(tasc)[,] #show the output of the aspect
#define a FLAT simple asc
tasc = as.asc(matrix(10,nr=10,nc=5),yll=75); tasc[,]
slope(tasc)[,] #show the output of slope
aspect(tasc)[,] #show the output of the aspect
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.