Hillshade¶
The hillshade shows the terrain as lit by the sun from a direction (the azimuth, clockwise from north) and an elevation over the horizon. Unlike the simple hillshades, it also casts the shadows of the terrain: the slopes hidden from the sun by the surrounding mountains are dark, even if they face it.
The usual hillshade for maps, as the one under the maps of this manual, lights the terrain from the northwest (azimuth 315) at 45 degrees. A low sun gives long shadows, which show the relief of flat areas better.
Parameters¶
Calculates the hillshade of the terrain, lit by the sun from a given direction and elevation, with the shadows cast by the surrounding terrain.
Toolbox folder: Hydro-Geomorphology
Status: Certified
Keywords: Hillshade, Shadow, Radiation, Visualization
Authors: Daniele Andreis and Riccardo Rigon
Class: org.hortonmachine.modules.Hillshade
Inputs
Parameter |
Type |
Unit |
Default |
Description |
|---|---|---|---|---|
|
raster file |
m |
The map of the elevation. |
|
|
double |
|
The diffuse light, between 0 and 1, added everywhere, also in the shadows. |
|
|
double |
° |
|
The azimuth of the sun, clockwise from north: 315 lights the terrain from the northwest, as in the usual hillshades. |
|
double |
° |
|
The elevation of the sun over the horizon: lower values give longer shadows. |
Outputs
Parameter |
Type |
Unit |
Description |
|---|---|---|---|
|
output file |
The map of the hillshade, from 0 for the shadows to about 212 for the slopes facing the sun. |
Example¶
The example runs on the sample elevation model of the manual, dtm_flanginec.tif in docs/manual/modules/maps/data, each module on the outputs of the previous ones:
import org.hortonmachine.modules.Hillshade
// the folder with the elevation model: change it to yours
var folder = "/data/flanginec/"
var hillshade = new Hillshade()
hillshade.inElev = folder + "dtm_flanginec.tif"
// a low sun from the west, for long shadows
hillshade.pAzimuth = 270
hillshade.pElev = 25
hillshade.outHill = folder + "shade.tif"
hillshade.process()
The hillshade of the sample area with a low sun from the west (azimuth 270, elevation 25): the long shadows of the ridges fall on the slopes to the east. The cells at the border of the map, without all the neighbours, are 0.¶