QGIS – How to: Extract building heights from LiDAR data and make 3D buildings

QGIS – How to: Extract building heights from LiDAR data and make 3D buildings


1) Download LiDAR data (both DSM and DTM) from here.  You will notice that depending on the area you click, different resolution products are available, e.g 25cm, 50cm, 1m, 2m. This is the distance between sampled points so the smaller the distance, the more detailed and the larger (file size) of the dataset. I went with 1m, the highest resolution for my area.

2) Extract the DTM and DSM zip files into separate folders. The contents will be a bunch of .asc files. These represent smaller tiles which make up the larger tile you downloaded. If you open one of these files in a text editor you will notice a bit of metadata at the top explaining where the data is located, resolution etc and then followed by a long list of values which are essentially just spot heights in meters.

3) In QGIS go to Raster > Misc > Build Virtual Raster (Catalog) and select all your DSM asc files and set an output file name. This will produce a .vrt which essentially creates a a single large virtual dataset from your individual .asc files.

Once complete, the VRT will be loaded onto the map and look something like this. (If prompted for a Coordinate Reference System (CRS), you will need to select EPSG27700, aka British National Grid.) You can see buildings as well as natural terrain features. Depending on your area, you may have gaps in LiDAR coverage like I do in the south east corner. Note that the bright white areas are water features – water absorbs LiDAR so no light is reflected and therefore no values can be determined.

4) Repeat the above process to create a DTM .vrt file.

5) The next step is to subtract the DTM from the DSM which will produce a new dataset containing the elevation of the surface features. To do this goto Raster > Raster Calculator and enter the following expression:

“combined_DSM_1m@1″ – “combined_DTM_1m@1″

Obviously substitute with your vrt layer names and also set the Output CRS to EPSG27700/British National Grid

This will produce a new layer which really highlights the surface features – even things like individual trees and field/garden boundaries are visible in my 1m dataset. If you are using 50 or 25cm data you should be able to pick out even finer details.

In this example we can see the parapet walls on the roof of The Circus and vegetation in the gardens

6) This step is optional –  we can view these surface features in 3D using the Qgis2threejs plugin (You can install it by going to Plugins > Manage and Install Plugins and searching for Qgis2threejs – you may need to restart QGIS after installing)

Here we have Bath Abbey – not bad from 1m LiDAR.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: