Skip main navigation

New offer! Get 30% off one whole year of Unlimited learning. Subscribe for just £249.99 £174.99. New subscribers only. T&Cs apply

Find out more

Digital elevation models in QGIS

A practical demonstration of working with DEMs in QGIS.

We are going to add and visualise our elevation data in QGIS.

Adding the data

Hopefully you should be getting familiar with this process by now!

  • 1) Open QGIS. Start a new project if you like, otherwise open your old one.
  • 2) On the main menu select ‘Layer’ > ‘Add Layer’ > ‘Add Raster Layer’.
  • 3) Click the browse button and find your course folder.
  • 4) Change ‘File Type’ to ‘GeoTIFF’.
  • 5) Click on your SRTM data, it should start with an ‘n’ and end with ‘_v3.tif’.
  • 6) Click the ‘Open’ button, and then ‘Add’, and ‘Close’.

Add SRTM data screenshot Adding the SRTM data.

A black and white image should now have appeared in your map window. There will also be a new raster in your layers panel. It will show the maximum elevation value for your dataset at the top of the black/grey/white bar, and the minimum at the bottom.

SRTM tile screenshot SRTM DEM in QGIS.

Visualising the data

These colours are not very attractive, so let’s change them!

  • 1) Right-click your SRTM data in the layers panel and select ‘Properties’.
  • 2) Click on the ‘Symbology’ tab.
  • 3) At the top, change ‘Render type’ to ‘Singleband pseudocolour’.
  • 4) Next to ‘Color ramp’ click the small black arrow and then go to ‘All Color Ramps’.
  • 5) Select the one you think looks best, ‘BrBG’ (the second on the list) is similar to what you see on a lot of colour topographical maps.

Selecting colour ramp screenshot Selecting a colour ramp.

  • 6) If the colours are the wrong way round, you can reverse them by clicking the black arrow again and selecting ‘Invert Color Ramp’.
  • 7) Click ‘Apply’ and ‘OK’, and then have a look at your map! Now each pixel is coloured based on its height – low values in one colour and high values in another.

If your area of interest is on the coast, there is an easy way to make it look even better.

  • 1) Right-click your SRTM data in the Layers panel and select ‘Properties’.
  • 2) Click on the ‘Transparency’ tab.
  • 3) Under ‘Additional no data value’ type a 0 in the box.
  • 4) Click Apply and OK.

Transparency properties screenshot Changing transparency settings.

The sea will now have disappeared, showing the coastline!

Final colours DEM screenshot Our colourful DEM.

Hillshades and transparency

There is an extra step that we can follow to make our DEM look even better, to make it easier to read the topography. Hillshading is a process of adding shadows to a map that would be cast by the sun when it is in a particular location. It is a great way of showing relief – the difference between the higher and lower parts of the terrain. Hillshading makes it easier to interpret the landscape because it mimics how we would see things if we were actually above the surface of the Earth. QGIS can work out where these shadows should be automatically using our elevation data.

We create our hillshade using a second copy of the SRTM data.

  • 1) Right-click the DEM in the ‘Layers’ panel and select ‘Duplicate Layer’. This will create a copy of the DEM, so you will have two identical versions in your ‘Layers’ panel.
  • 2) Right-click the top version, select ‘Properties’, and click on the ‘Symbology’ tab.
  • 3) Change ‘Render type’ to ‘Hillshade’.
  • 4) Change ‘Z factor’ from 1 to 0.00001.

Hillshade symbology screenshot Hillshade symbology.

We need to do this because the elevation values are measured in metres, but the raster pixels are based on degrees of latitude and longitude. There are roughly 111km to one degree, if you divide one by 111,000 you get (roughly!) 0.00001.
  • 5) Click ‘Apply’ and ‘Ok’.

This generates a model showing the shadows and patches of bright light that would be cast by the sun at a particular angle, but on a completely grey landscape – a bit like the moon!

Hillshade model screenshot A hillshade model.

This model will look a lot better if we can see the colours of our DEM underneath it, so we are going to make our hillshade partially transparent.

  • 6) Make sure both copies of the SRTM data are turned on in the ‘Layers’ panel.
  • 7) Right-click the bottom version, select ‘Properties’, and click on the ‘Transparency’ tab.
  • 8) Change ‘Global Opacity’ from 100% to 50% – you can use the slider or type it with the keyboard.
  • 9) Click Apply and OK.

You should now have a colourful relief map of your area of interest!

Final hillshaded DEM screenshot Combined hillshade and DEM relief model.

In the next section we will be using our SRTM DEM to create new datasets for our area of interest.

This article is from the free online

Advanced Archaeological Remote Sensing: Site Prospection, Landscape Archaeology and Heritage Protection in the Middle East and North Africa

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now