Learn R Programming

satellite (version 0.1.0)

demTools: Compute terrain characteristics from digital elevation models

Description

Compute terrain characteristics from digital elevation models (DEM) using raster::terrain or raster::hillShade.

Usage

## S3 method for class 'Satellite':
demTools(x, method = "hillShade", bcde = "DEM")

## S3 method for class 'RasterLayer': demTools(x, sunElev, sunAzim, method = "hillShade")

Arguments

x
A DEM provided as an object of class Satellite or RasterLayer.
method
Currently "slope", "aspect" and "hillshade" are implemented.
bcde
The name of the DEM layer in the satellite object.
sunElev
If method = "hillShade", the elevation angle of the sun in degrees. See parameter angle in hillShade.
sunAzim
If method = "hillShade", the sun azimuth angle in degree. See parameter direction in hillShade.

Value

  • If x is a Satellite object, a Satellite object with added layer containing calculated terrain information; if x is a raster::RasterLayer object, a raster::RasterLayer object with calculated terrain information.

See Also

raster::terrain, raster::hillShade.

Examples

Run this code
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC8*.tif"), full.names = TRUE)
sat <- satellite(files)

## dem
files_dem <- list.files(path, pattern = "DEM", full.names = TRUE)
DEM <- raster(files_dem)

sat <- addSatDataLayer(sat, data = DEM, info = NULL, bcde = "DEM", in_bcde="DEM")
sat <- demTools(sat)

Run the code above in your browser using DataLab