[GIS] Creating fine interval contour layer from DEM using QGIS

contourdemqgis

I would like to create 20 meter contours for a large region, roughly 120,000 square kilometers. DEM data is available as TIFF or CSV throughout this region at 0.75 arc second resolution.

What tools should I use to create a coverage of 20 meter contours throughout this region? I am concerned that large file sizes will present a problem.

I have tried using the contour tool (Raster>Extraction>Contour). As well as the Contour Plugin which uses DEM point data as an input. I am running into trouble with large file sizes.

Best Answer

That should work using QGIS' contour tool (Raster -> Extraction -> Contour), with contours being interpolated where necessary.
This tutorial should cover the workflow in case you're new to this.

You could try and split your contours into multiple extracts, e.g. 5 layers with 100m intervals, consecutively starting every 20m (0 - 80m), if loading a single file is too slow (or reaches file size limits, depending on your output format). If the data is provided in a grid of connected files, don't merge them and extract the contours per file. This might cause jumps between contours at the layers' edges but lets you choose which layers to display

However, the amount of created features will indeed be massive and creating/using these layers within any GIS might be a large pain in the. Depending on your application, it might be worth considering to use a database like PostgreSQL/PostGIS to be able to query only those features necessary to work with (by bounding box or sth. similar).

EDIT:
I wrongly assumed the Contour tools' GUI would offer an offset option (wasn't it there in some versions?). QGIS uses the mighty GDAL under the hood for raster calculations, and here, the gdal_contour module in particular.
At the bottom of the GUI window you see the exact command that is executed. You can edit the command via the edit button: adding -off <offset_in_m_from_0> to the commands options will do the trick.

Alternatively you can run that command directly from your OS terminal/console (GDAL is shipped with your QGIS installation, look for the gdal_contour.exe and open your terminal there to be able to use it)

Related Question