Skip to content

Instantly share code, notes, and snippets.

@rbanick
Last active January 22, 2018 22:23
Show Gist options
  • Save rbanick/9008c8adc18acfe089af to your computer and use it in GitHub Desktop.
Save rbanick/9008c8adc18acfe089af to your computer and use it in GitHub Desktop.
Creating Hillshades in QGIS
QGIS Hillshades are not hard, but they're often a little screwy. That's because units of measurement for elevation and x/y are often different. So, for instance, your DEM may be projected in WGS84 and hence have decimal degree units. But the DEM elevation units are often in meters. You need to account for this in the "scale" setting of QGIS.
The basic rule of thumb is this:
If everything is in meters, use scale factor 1.0 (default).
If x/y is in degree and z in meters, use scale factor 111120.
If x/y degree and z is feet, use scale factor 370400.
So, in QGIS 2.6, go to Raster --> Analysis --> DEM (Terrain Modules)
Load up your data, name the new file, and leave all the settings the same EXCEPT for scale. In most cases (SRTM data) you'll then rename scale to 111120.
*Please note* that 111120 is for equatorial countries. It works fine for near equatorial countries as well. For countries farther away you'll have to recalculate the value yourself. You can find the relevant equations in the first answer here: http://gis.stackexchange.com/questions/95337/scale-and-z-factor-have-no-effect-on-hillshade-analysis-in-qgis
More info:
http://anitagraser.com/2012/01/19/a-guide-to-beautiful-reliefs-in-qgis/
http://niketnarang.wordpress.com/2012/06/11/creating-a-hill-shade-from-dem-using-qgis/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment