Table of Contents
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.
It is worth noting that a depressionless DEM does not guarantee that there will be no contour sinks. A deep diagonal channel combined with a small contour interval can still cause sinks.
See GIS Stack Exchange for options of how to deal with this.
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:
- GRASS : v.generalize
V.generalize can also be used to smooth contours - possibly best done prior to simplificiation
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. However, that shouldn't be a problem in most scenarios.
- 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)
See separate page on QGIS Contour Labelling