Skip to contents

This tool performs a hillshade operation (also called shaded relief) on an input digital elevation model (DEM) with multiple sources of illumination.

Usage

wbw_multidirectional_hillshade(
  dem,
  altitude = 30,
  z_factor = 1,
  full_360_mode = FALSE
)

Arguments

dem

Raster object of class WhiteboxRaster. See wbw_read_raster() for more details.

altitude

double, the altitude of the illumination sources. i.e. the elevation of the sun above the horizon, measured as an angle from 0 to 90 degrees

z_factor

double, Z conversion factor is only important when the vertical and horizontal units are not the same in the DEM. When this is the case, the algorithm will multiply each elevation in the DEM by the Z conversion factor

full_360_mode

boolean, default FALSE. I.e. whether or not to use full 360-degrees of illumination sources. When FALSE (default) the tool will perform a weighted summation of the hillshade images from four illumination azimuth positions at 225, 270, 315, and 360 (0) degrees, given weights of 0.1, 0.4, 0.4, and 0.1 respectively. When run in the full 360-degree mode, eight illumination source azimuths are used to calculate the output at 0, 45, 90, 135, 180, 225, 270, and 315 degrees, with weights of 0.15, 0.125, 0.1, 0.05, 0.1, 0.125, 0.15, and 0.2 respectively.

Value

WhiteboxRaster object

Details

The hillshade value (HS) of a DEM grid cell is calculate as: $$HS = \frac{\tan(s)}{\sqrt{1 - \tan(s)^2}} \times [\frac{\sin(Alt)}{\tan(s)} - \cos(Alt) \times \sin(Az - a)]$$ where \(s\) and \(a\) are the local slope gradient and aspect (orientation) respectively and \(Alt\) and \(Az\) are the illumination source altitude and azimuth respectively. Slope and aspect are calculated using Horn's (1981) 3rd-order finate difference method.

References

For more information, see https://www.whiteboxgeo.com/manual/wbw-user-manual/book/tool_help.html#multidirectional_hillshade

Horn B.K.P., 1981, Hill shading and the reflectance map, Proceedings of the I.E.E.E. 69, 14

See also

Examples

f <- system.file("extdata/dem.tif", package = "wbw")
wbw_read_raster(f) |>
  wbw_multidirectional_hillshade()
#> +-----------------------------------------------+ 
#> | WhiteboxRaster                                |
#> | dem.tif(Hillshade)                            |
#> |...............................................| 
#> | bands       : 1                               |
#> | dimensions  : 726, 800  (nrow, ncol)          |
#> | resolution  : 5.002392, 5.000243  (x, y)      |
#> | EPSG        : 2193  (Linear_Meter)            |
#> | extent      : 1925449 1929446 5582091 5585717 |
#> | min value   : 0.000000                        |
#> | max value   : 28354.000000                    |
#> +-----------------------------------------------+