User Tools

Site Tools


nsw_lidar

This is an old revision of the document!


Intro

NSW Spatial Services have undertaken a program to map all of NSW using lidar (light detecting and ranging) For details, see information on their elevation program.

Elevation data can best be accessed through the Geoscience Australia ELVIS program.

It can then processed with a GIS such as QGIS to create useful topographic maps. Instructions below are specifically for use with QGIS, though the general outline may be useful for other GISs.

Resources

Topographic maps

There are several primary data items for topographic maps that can be generated using the DEM data from the NSW Lidar. The main ones are:

  • Contours
  • Hydrology (Stream Network)
  • Clifflines

The steps below are works in progress to determine effective (the best?) ways to extract the various items out of the DEM data for use in topographic maps. Any feedback/suggestions of improvements are welcome.

Merge DEMs

The NSW DEM data is supplied in 2km squares. The squares need to be merged into a single DEM for further operations.

While this can be done in theory using a virtual raster, I have had poor performance with this. Any operation seems to result in screen redrawing, so moving around and zooming in and out is quite slow and painful.

Instead, I generally use the the Raster- > Miscellaneous → Merge… function

Fill Sinks

From the initial DEM, first step is to Fill Sinks. Otherwise you will get sinks in the middle of watercourses, which will impact contours and stream networks. Note that the this approach needs to be used with care in areas where there are actual depressions.

There are various related tools in the Processing Toolbox that will do this, including:

  • SAGA : Terrain Analysis - Hydrology : Fill Sinks
  • SAGA : Terrain Analysis - Hydrology : Fill Sinks (Wang and Liu)
  • SAGA : Terrain Analysis - Hydrology : Fill Sinks XXL (Wang and Liu)

The results from all will be similar, but the Wang and Liu versions should be faster.

There are other approaches that deepen channels rather than fill sinks in order to get a hydrologically sound drainage network. For example

  • SAGA : Terrain Analysis - Hydrology : Sink Removal

has an option for this.

Contours

Basic Processing

There are various contour extraction algorithms in QGIS, for example:

  • GDAL : Raster Extraction : Contour (same as Raster → Extraction → Contour…)

Below is an example of contours created without and with sink removal. The contours on the right have been derived from a DEM where the sinks (in yellow on the left) have been filled.

Even with sink removal, small

Simplifying

Vectors can be compressed by using something like:

  • Vector geometry : Simplify

A tolerance of 1(m) seems reasonable for 1:25000 mapping. Smaller tolerances may be appropriate for larger scale maps (eg 1:10000, 1:5000).

For more options in compression, look at:

V.generalize can also be used to smooth contours - possibly best done prior to simplificiation

Cleaning

Once simplified, it is worth removing small closed loops, such as those in the image below.

Here is one approach, which involves adding a length attribute to each contour, and removing those that fall below a certain length. It may cause issues if you have short sections of contour near the edge of the map that you need.

  • Open Attribute Table (F6)
  • Open field calculator (Ctrl+I)
  • Add new attribute length, calculated as $length

  • Select all features and filter on length < 25 (or whatever length is appropriate for your scale)

Contour Labelling

See separate page on QGIS Contour Labelling

Hydrology (Stream Network)

The starting point for hydrology is a hydrologically sound DEM, as above. Use a fill sinks or channel deepening algorithm.

Catchment Areas

Next step is to create Catchment Areas. Again, there is a Catchment Area tool (in fact several), and six methods within the tool. For the purpose of delineating watercourses in steep terrain, the choice of method probably makes little difference.

  • SAGA : Terrain Analysis - Hydrology : Catchment Area

This gives an output that is best viewed in log scale. You can do this via

  • Raster → Raster Calculator…
    • log10 ( “Filled DEM@1” )

Use the log scale version to determine the cutoff for what streams you want to see and which ones are too small. 10000 seems to give comparable results to the existing 1:25000 maps.

Note that if you don't have the entirety of the catchment, you may get erroneous results.

Channel Network

The following tool can be used to create channels (streams) - there are other options:

  • SAGA : Terrain Analysis - Channels : Channel Network

Use

  • Elevation = Filled DEM
  • Initiation Grid = Catchment Area
  • Initiation Type = Greater Than
  • Initiation Threshold = 10000 (or whatever number you have determined)

Classification

For 1:25000 maps, I've had reasonable results from using the following formula in the Raster Calculator to classify the streams into categories. Different scales may need different bounds, and this doesn't account for significantly larger rivers.

( log10 ( “Catchment Area@1” ) >= x) * ( log10 ( “Catchment Area@1” ) < y) * (“Channel Network@1” != 0)

  • Intermittent: 4-6.15 (x-y)
  • Minor: 6.15-7.4
  • Major: 7.4+

Convert to Vector and Simplify

Convert to vector using r.to.vect

The raw stream data is very jagged. Smooth using

  • v.generalize
  • Algorithm = Hermite (there are other options which can be used)
  • Maximal tolerance value = 20 (in m, obviously scale dependent)

Simplify using using:

  • Vector geometry : Simplify

Tolerance:?

Clifflines

The steps below have been tested in the Blue Mountains, a region that has a significant number of relatively vertical sandstone cliffs. It may be less effective in different terrain.

This is more a set of ideas than a fully fledged process. The main aims are to get a set of steps that can largely be automated, and that create cliffline vectors that are running in the correct direction. There is still some way to go on this!

Initial analysis of slope, aspect

SAGA → Terrain Analysis - Morphometry → Slope, Aspect, Curvature

Extract

Slope, Aspect 

using DEM and [1] Maximum Triangle Slope (Tarboton (1997)). I haven't tested any other algorithms.

Cliff areas can be identified using a range of 60-90 and 70-90 degrees on the Slope file. Using 60-90 degrees helps connect logical cliffs and avoid small breaks.

Initial Cleaning

Next convert data to 1 bit (1,2 not 0,1, as Sieve ignores 0s) using Raster Calculator. Formula is: (Slope > 0) + 1

Then Sieve resulting data using a Threshold of 100 and 8-connectedness to get rid of small non-connected cliffs. Note above that Sieve doesn't like 0s.

Also good to rerun Sieve with smaller Threshold (1-10) and 4-connectedness to a) get rid of some small dangles. b) fill small holes.

Additional smoothing can be done using a User Defined Filter with the following matrix. This will apply some smoothing by allowing you to reclassify the pixel values, and remove single pixel indentations like this:

000    000
101 -> 111
111    111

and single pixel protrusions like this:

000    000
010 -> 000
111    111

The main problem is that the matrix has to be defined each time in QGIS. There doesn't seem to be an option to load it. Possibly this can be done outside QGIS.

Matrix is:

0.0 0.5 0.0
0.5 0.5 0.5
0.0 0.5 0.0

If the original matrix is 0/1 then the cutoff will be 1.5

If the original matrix is 1/2 then the cutoff will be 3.5

This step could be run multiple times - some testing would need to be done to determine how many times.

Other options for cleaning the data include a plugin called LecoS, but this doesn't work on QGIS 3. Another possibility is Shrink and Expand - radius 1? But this also creates some new holes that didn't previously exist, so not ideal.

Thinning

Convert back to 0/1 data using Raster Calculator

Use Translate: set Output Data Type = Byte, set NoData = 0

Run r.thin - r.thin is quite picky about the input file format. Needs to be NULL/non-NULL (not float or int). The Translate process above provides this. The previous two steps could be combined into one. Also, this file may need to be explicitly saved (not just a temporary file?!)

Vectorising

Run r.to.vect: set Feature Type = line

Run v.clean: Cleaning Tool = rmdangle, Threshold = 5,10

nsw_lidar.1549834102.txt.gz · Last modified: 2019/02/10 21:28 by bushwalking