How to create Lidar contours with QGIS


QGIS (Quantum Geographic Information System) is a powerful and widely-used open source GIS program. One key use for orienteering mappers is the means to process Lidar data and create contours. Current and recent versions of Ocad have built-in Lidar support: QGIS gives earlier Ocad versions and OpenOrienteering Mapper similar functionality.

QGIS is free to download. It’s a large program and may take a while! The current version (10 June 2021) is 3.26 ‘Buenos Aires’. These notes are for version 3.10.


Obtaining Lidar data

Go to Defra Survey Data Download

https://environment.data.gov.uk/DefraDataDownload/?Mode=survey

Zoom the map in to the desired location with your mouse. You will see the OS 5km x 5km grid tiles.
Select the Polygon tool on the right and draw the rough area you want.


Click Get Available Tiles and wait until the right-hand box changes to a 'Download your data' box with options.
Product: choose National LIDAR Programme DTM
Leave Year and Resolution as they are.

Under ‘Available tiles’ you’ll see a link something like National-LIDAR-Programme-DTM-2021-SY49se. Click to download the zip file.

Save it where you like on your PC and extract the files. You’ll find the .tif format file QGIS will process in a subfolder.


Starting QGIS

Open the QGIS Desktop.

From the top menu select Plugins / Manage and Install Plugins. Scroll to 'Contour plugin'. Check the box and install it.
(You only have to do this once, the first time you use QGIS).

From the top menu select Project / New.
Then select Layer / Add Layer / Add Raster Layer.


A Data Source dialogue box appears asking you what Raster Dataset(s) to use.
Click the Browse button to the right and navigate to your Lidar .tif file.

Click the filename. Then Open / Add / OK.
Close the dialogue box.

Extracting contours

In the top menu select Raster / Extraction / Contour. Your file should appear in the Contour dialogue box / Input layer.

Choose the Interval between contour lines, e.g. 5m. Run. Close when finished.

In the Layers panel on the left, you can use the checkboxes to toggle the original layer or the contours on or off. If you want contours in a different colour, right-click on the word ‘Contours’ and select Properties.

Select another file & repeat if wished.

Smoothing the contours (optional)

After creating contours go to
Processing (top bar)
Toolbox
Vector geometry
Simplify
(double click)

Tolerance is the distance between contour nodes. Try 2 metres.
Modify All Features

Then back to Vector geometry / Smooth (double click)

Set number of Iterations, say 3.
Modify All Features

(After Processing / Toolbox you may need to click Edit features in place tab to see list which includes Vector geometry. Different QGIS versions have their idiosyncracies!)

Preparing a background map (non-georeferenced)

In the top menu select Project / Import/Export / Export Map to Image.

In the 'Save Map as Image' box change Resolution if you wish to. I usually increase it to at least 192 dpi for detail clarity.

Save. Browse to where you want it saved on your PC.
Give it a File name. In 'Save as type' select image format - normally JPG.

You should now be able to open it in Ocad as a Background map.

Note: the image you save is the area onscreen. If you’ve zoomed in, you may want several images. They can be opened as separate background maps or stitched together with editing software like Adobe Photoshop or PaintShop Pro.


Preparing a background map (for georeferenced maps)

In the top menu select Project / Import/Export / Export Project to DXF.

In the 'DXF export' box browse to where you want it saved on your PC. Give it a File name. Save.
You are saving the whole area, not just the onscreen image.

Open your Ocad map. Important: Back it up! This is because, as far as I can discover, the Import process is irreversible!

Go to File / Import. Find the DXF file. It will open as a grey basemap. Brown contour lines can either be created directly by assigning the appropriate Ocad symbol, or you can draw over the grey lines yourself.

 

You can download or print these instructions as a pdf.

Mike Kite, July 2022

 

Background: 1m contours of Langdon Hill and St Gabriel's, Morcombelake, Bridport