User Tools

Site Tools


nsw_merge_dems

Merging DEMs

NSW DEMs

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

Most of the eastern ranges, where a lot of bushwalking happens, are 2m resolution DEMs. The coast is typically 1m, and the western slopes and plains are 5m (with areas around major rivers 1m!). Be careful if you need to merge DEMs with different resolutions - see below for more details.

The data comes as zipped .TIF files, with separate folders by resolution (1m/2m/5m). The .TIF files can then be dragged and dropped into QGIS.

[Previously the data came as doubly zipped .ASC files, so the individual zip files needed to be extracted to a folder, and then unzipped themselves.]

Merge Raster

There are various ways to merge rasters in QGIS.

The simplest is probably to use the the Raster- > Miscellaneous → Merge… function.

Internally, QGIS uses gdal_merge, which defaults to using the resolution of the first file. This is not always desired. It can be controlled by using the optional -ps (pixel size) switch. For example, if you have a combination of 1m and 2m DEMs, you can use -ps 1 1 to force them to a merged 1m DEM, or -ps 2 2 to force them to merge to a 2m DEM.

Virtual Raster

It is also possible to merge DEM data in QGIS using a Virtual Raster (Raster- > Miscellaneous → Build Virtual Raster… ). Note that the performance of these within QGIS seems poor. Any operation seems to result in screen redrawing, so moving around and zooming in and out is slow and painful.

However, if you are just using the Virtual Raster for future steps, then the limitations from the screen redrawing may not be important.

Internally, QGIS uses gdalbuildvrt. Uncheck “Place each input file into a separate band”, and if you are using files with different resolutions (eg 1m and 2m), change the Resolution to Highest or Lowest as appropriate.

You can also change the Resolution to User, and set the optional -tr switch (eg -tr 1 1 or -tr 2 2).

See Managing large DEMs for more information on large Virtual Rasters, and how they can be used as an initial step to quickly get a merged DEM for an area of interest.

nsw_merge_dems.txt · Last modified: 2023/10/24 08:05 by bushwalking

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki