Getting Height Maps from QGIS

  • 01 Open a raster layer > Navigate your filesystem to find the heightmap - christchurch-15m-dem-height-corrected_1-0001-0001.tif
    01 Open a raster layer > Navigate your filesystem to find the heightmap - christchurch-15m-dem-height-corrected_1-0001-0001.tif 
  • 02 You will see a grey rectangle appear. To show the map you will need to alter the colour contrast. Right click on the Christchurch raster layer > Select Properties
    02 You will see a grey rectangle appear. To show the map you will need to alter the colour contrast. Right click on the Christchurch raster layer > Select Properties 
  • 03 Load min / max values from band > Select Actual. This will get the lowest and highest height from the layer and fill the Custom min / max values.
    03 Load min / max values from band > Select Actual. This will get the lowest and highest height from the layer and fill the Custom min / max values. 
  • 04  Assign colours by clicking Contrast enhancement > Stretch To MinMax > OK.
    04 Assign colours by clicking Contrast enhancement > Stretch To MinMax > OK. 
  • 05 You will now see the map shown in grayscale
    05 You will now see the map shown in grayscale 
  • 06 To find a feature, left click and drag to pan the map. Use the scroll wheel to zoom in.
    06 To find a feature, left click and drag to pan the map. Use the scroll wheel to zoom in. 
  • 07 Take a screenshot (Print Screen) and crop it square using your favourite graphics software.
    07 Take a screenshot (Print Screen) and crop it square using your favourite graphics software. 
09/14/2012 - 05:13

QGIS is an application that can build and change maps. It is free open source software and can be downloaded from the QGIS website. It runs on Linux, MacOS X, and Windows. In this tutorial I will show you how to use it to export height maps.

To follow along install QGIS, and download a height map of Christchurch. The tutorial is contained in the slides above.

This tutorial shows a simple method for extracting height maps, but it is limited to the resolution of your screen. QGIS's Print Composer can provide higher resolution height maps.

The reason for using QGIS is that it can open a variety of Data Elevation Model (DEM) file formats. In the modeling world DEMs are known as height maps. What makes these formats special is that they are arrays, with each cell containing a height. These heights can be just numbers, or represented in grayscale. These values can be from 0 to anything. QGIS can export using common graphic formats, like .png, .bmp, .jpg, tiff.

Some formats may only have 256 colours in each channel. This maybe inherent in the source artwork, or maybe limited by your hardware. QGIS can help you make the most of these limited DEMs. If you had a mountain that was 2560m high, each shade of grey would equal 10m. If that mountain was on a plateau, that was itself 2560m high, it'd be 5120m. Then each shade would be 20m. QGIS can fix this. QGIS will do it automatically if you choose Layer > Properties > Current Extent. This will find the lowest and highest point visible on screen and adjust the Custom min / max values. This will produce a more accurate height map.

Load Min/Max heights from the map you see on the screen

Or you can manually choose a custom minimum and maximum height. In this case you would set the Min to 2560 and Max to 5120.

Set custom Min/Max heights

These exported height maps can then be used to create 3d models. You can do this with any good 3d modeling software. I do this using, the free software, Blender. You can see how I do it in my tutorial Make mountains in Blender from height maps.

Add new comment