Making Heightmaps

Published in xyHt October 17 2017:

So there is no hiding it, I’ve been building a lot of 3d data recently, partly to sell, partly to fuel my adventures into augmented reality (if your interested in me adding this to the blog, please say!). The main thing that has been vital has been the heightmap.

What is a heightmap you might ask, well it can be called several names but I use this term to describe a raster which contains the relative heights necessary to extrude and height features in the third dimension. Of course, there are many ways of injecting height information into your data, from the conversion tools for LiDAR, which create heighted footprints directly from the point cloud, through to deriving data from the DSM but the reason I create a height map is so that I can extract other features and has been a method I’ve used for years as it provides certainty in the heights no matter what the datum.

DSM – DTM = Heightmap

The heightmap is essentially the heights derived from taking the values in your Digital Surface Model (DSM) away from your Digital Terrain Model (DTM). Normally, a DTM will be derived from the DSM, I could go into loads of nerdy detail but there are many tools within both the survey software and GIS to do this. So, knowing this and provided your DSM & DTM are from the same capture date (datum & cell size are similar) you can simply take one raster from the other (DSM from DTM) and the resulting raster will be relative heights.

The Raw Heightmap
Coloured so that you can see it better – Pixel value is the height






Why not extract the heights from the DSM? It would be easier to just extract the heights on the DSM using footprints using an algorithm that provides the height where the two intersect. The simple answer is to avoid datum issues. You see, if I height the data based on the DSM, then the height for the object would be relative to the datum of the DSM, if I chose to use another datum (based on the same units of height), the heights would be wrong. For me, this is a huge issue as I want to create 3D data which can be used on several platforms, therefore the heights of the data would be wrong, when basing heights on the DSM. Using the “heightmap” method means that the height of the features aren’t tied to a datum and the heights extracted can be used relative to any terrain/surface (using the same units of vertical measure).

Hopefully, you are still reading this and haven’t fallen asleep due to my incessent push for the “heightmap”, let’s have a look at creating one using the open source Environment Agency composite LiDAR.

  1. Go to
  2. Download the 1m Composite DSM & the 1m composite DTM (ensure you get matching tiles!)
  3. Chooses your GIS weapon of choice and open the “Raster Math” – Note that this is free in QGIS & GRASS but you will require the Spatial Analyst or 3D Analyst plugins (at cost) for Esri software
  4. Use the raster math to “minus” the DSM from the DTM & export the result as GeoTiff
  5. You now have a heightmap!
The rather awesome EA LiDAR Portal

With this new shiny heightmap you can use the point sampling tool in QGIS to get height values into your attribute table of your footprints or in Esri software you will want to use the “Interpolate Shape” function. Either way, the result is a shiny 3D data for you chosen 2.5D, 3D or 4D software, something like the data below!

Resulting 3D Buildings

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.