Skip to main content
19 votes

Producing smooth and consistent contour lines from SRTM

To smooth your contours it is the best way to smooth your DEM first. Here are some useful information: What raster smoothing/generalization tools are available? I'm using SAGA GIS for this task. ...
Stefan's user avatar
  • 4,424
16 votes

Convert raster to smooth contour polygons in QGIS

I've experienced the same problems you area having in your second method. I exported a Raster to a Vector and try to and use v.generalise and I get mostly smooth polygons with the occasional 'stepped' ...
Andrew Jeffrey's user avatar
16 votes
Accepted

Avoiding too curly contours in QGIS

Extract by expression lines over a certain length, I use 100 m: $length>100 to remove the small rings Simplify and smooth output with geometry by expression: smooth(simplify( $geometry, 4), 20). ...
Bera's user avatar
  • 74.8k
13 votes

How to perform a slope analysis in QGIS?

Slope analysis is performed on a DEM (raster layer with elevation values). This is one way to do it. If your contours have an elevation value, you can use the interpolation option (raster/...
Gerardo Jimenez's user avatar
12 votes

How to replace pixel values in a single band DEM?

You can do something similar using gdal_calc.py, e.g.: gdal_calc.py -A dtm.tif --calc='((A>=100)*(A<=200))*A+((A<100)*0)+((A>200)*0)' --outfile=dtm_reclass.tif --NoDataValue=-32767 This ...
dmci's user avatar
  • 4,902
12 votes
Accepted

Changing blending of contour label to multiply

You can change the blend mode of the text buffer in label settings (see below). Multiply works best if the buffer colour is a dark colour. However, that won't achieve what you have in your ...
she_weeds's user avatar
  • 12.6k
11 votes
Accepted

Styling contours at specific numbers

Try to do the following formula at Rule-based Style "FieldName" % 1 = 0 (Assign thick lines for 1 meter interval lines) ELSE (Assign thin lines or any other style for other ...
ahmadhanb's user avatar
  • 41.1k
9 votes

Interrupting contour lines beneath elevation labels (instead of using label buffers) using QGIS?

UPDATE: the following workaround was only needed because label masking was not possible in PDF or SVG exports. Since QGIS 3.26 selective masking is also available in high quality vector outputs: https:...
christoph's user avatar
  • 5,857
9 votes
Accepted

Transform tif file to shapefile to get outer contour of area

Use the raster calculator to create an output raster with 1 where the raster equals itself. Input (nodata shown in light blue): Calculator: Output (nodata shown in light blue): Then polygonize the ...
user2856's user avatar
  • 67.1k
9 votes

Styling contours by colour and by line thickness in QGIS

Step 1 - Configuring the symbology type (only necessary if your contours are polygons) Change the symbology of the fill from "Simple Fill" to "Outline: Simple Line" Step 2 - Stroke ...
TeddyTedTed's user avatar
  • 6,130
9 votes

Styling contours by colour and by line thickness in QGIS

Thanks to the insightful answers and comments I realized that, after applying color by graduated symbols or a color ramp, I could follow the logic suggested by both @Kadir ┼×ahbaz and @TeddyTedTed in ...
Leigh Bettenay's user avatar
8 votes

Convert raster to smooth contour polygons in QGIS

A more direct way is to use gdal_countour directly (as a command-line program) in "polygonal mode" (that is, with the -p option). Example: gdal_contour -p -amin min_val -amax max_val -i 1 ...
Paulo Vieira's user avatar
8 votes

Creating DEM from contours in QGIS?

I just posted this answer on another thread that was asking the same question. This is by far the easiest method that I have found. I had the same question and looked everywhere! Finally a solution - ...
Marina's user avatar
  • 126
8 votes
Accepted

QGIS - Create single contour line at specific height from DEM

Just a couple of examples are: QGIS main menu Raster | Extraction | Contour Processing Toolobox SAGA | Vector <-> raster | Contour lines (or SAGA | Vector to raster | Contour lines) (1) QGIS ...
Kazuhito's user avatar
  • 31k
8 votes
Accepted

Making elevation contours of raster smoother using QGIS

In my case, I have a DEM with continue values, going from 100 to 103 meters. The spatial resolution is 0.25 x 0.25 degrees, defined in EPSG:4326. The DEM is styled with a discrete color ramp with ...
Gabriel De Luca's user avatar
8 votes

Creating topographic "layer cake" map a.k.a. Tanaka contour in QGIS

Illuminated Contours, often called Tanaka Contours. There are many different ways of creating them in QGIS. Keep in mind that quite a few of the older tutorials are now out of date as newer versions ...
Tom Brennan's user avatar
  • 5,249
7 votes
Accepted

Exporting contour lines from CAD to GIS

If it is 3D DXF, follow the steps: import the dxf in QGIS (DRAG & DROP or CTRL + V); save as vectors (as the right mouse button); add new field Z (integer); Browser Panel to create a new database ...
pigreco's user avatar
  • 4,500
7 votes

Exporting contour lines from CAD to GIS

@pigreco's answer should work. But here a simpler solution without the spatialite process (step 1 to 2 are the same). Load your .dxf and export (save as...) as shapefile (or spatialite / postgis). ...
Pierma's user avatar
  • 901
7 votes

Showing contour line elevation labels in QGIS?

Right click the layer and open the attribute table - the elevations should be in here under one of the columns. Identify the name of the relevant elevations column, and select this from the drop down ...
Maggie's user avatar
  • 401
7 votes

Plotting a heat map onto background in python using kde?

gplt.kdeplot do not uses the value column for each point, but you can select the column row values of the GeoDataFrame for that as in KDEPlot of two NYC traffic accident contributing factors (...
gene's user avatar
  • 55.1k
6 votes

Choosing only one contour line to label in QGIS?

Another convenient expression is "ELEV" LIKE '%00' (step 100m) or "ELEV" LIKE '%00' OR "ELEV" LIKE '%50' (step 50m) or "ELEV" LIKE '%0' (step 10m) etc, where "ELEV" is my data elevation field. The ...
Antonis's user avatar
  • 61
6 votes

Interrupting contour lines beneath elevation labels (instead of using label buffers) using QGIS?

Since QGIS 3.12, this can be done via basic in-built QGIS functionality using label masks. Under the Labels tab in Layer Properties, Enable mask, and provide a size: Under the Mask tab in Layer ...
Tom Brennan's user avatar
  • 5,249
6 votes

QGIS Heatmap by value (NOT by point-densty)

What you actually want to perform is an interpolation. Heat maps are used to estimate point density between observed points. When you check "Use weights from field", you are expressing that each point ...
Lee Hachadoorian's user avatar
6 votes
Accepted

How to replace pixel values in a single band DEM?

I'm not sure if you can do this with any of the gdal cli tools, but I wrote something in python which accomplishes it: from osgeo import gdal from osgeo.gdalconst import GDT_Float32 import sys ...
jeremyeastwood's user avatar
6 votes

Computing pole of inaccessibility

You could use negative buffer values on your polygons. However, in your case, I would suggest the you compute the distance from your coastlines (Raster > Analysis > Proximity (Raster Distance)) in ...
radouxju's user avatar
  • 49.8k
6 votes

Adding contour line to heatmap in QGIS?

It is possible to simply add contours to a raster image via the Processing Toolbox -> Contour (Under GDAL Extraction). Here is an example: Input Raster Image created from point layer using QGIS ...
15Step's user avatar
  • 2,440
6 votes

Labelling contour lines in QGIS?

I feel the error comes from your contour generation. If you didn't set an elevation attribute name, the attribute gets skipped and you have no way to define what elevation your contours are at. Make ...
Gabriel's user avatar
  • 3,155
6 votes

Making elevation contours of raster smoother using QGIS

There are several tools that exist in qgis to smooth contour lines as opposed to smoothing the raster itself , including vector->geometry->simplify, the vector geometry tool "smooth", and the GRASS ...
Kartograaf's user avatar
  • 2,947
6 votes
Accepted

Why is QGIS contour generating tool not working with my DEM tiff file?

I downloaded your contour geopackage. Open it with QGIS, right click the layer -> Layer CRS -> Set Layer CRS -> Search for "3912" -> OK Your contour lines should be where you ...
sn1ks's user avatar
  • 3,022
6 votes
Accepted

Creating contours within an upper limited boundary

You can use the GDAL Contour Polygons from the processing toolbox: Contour polygons: This will generate polygons at the desired interval Then use the Processing Toolbox Intersection tool with your ...
Kasper's user avatar
  • 3,362

Only top scored, non community-wiki answers of a minimum length are eligible