Creating an elevation hillshade
A hillshade, or shaded relief, is a technique to visualize elevation data in order to make it photorealistic for presentation as a map. This capability is part of GDAL and is available in QGIS in two different ways. It is a tool in the Terrain Analysis menu under the Raster menu and it is also an algorithm in the Processing Toolbox.
Getting ready
You will need to download a DEM from https://geospatialpython.googlecode.com/files/dem.zip.
Unzip the file named dem.asc
and place it in your /qgis_data/rasters
directory.
How to do it...
In this recipe, we will load the DEM layer and run the Hillshade
processing algorithm against it. To do this, we need to perform the following steps:
Start QGIS.
From the Plugins menu, select Python Console.
Import the
processing
module:import processing
Load and validate the layer:
rasterLyr = QgsRasterLayer("/qgis_data/rasters/dem.asc", "Hillshade") rasterLyr.isValid()
Run the
Hillshade
algorithm, providing the algorithm name, layer reference...