Hot answers tagged

24 votes
Accepted

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

Yes, doable. Normally I'd suggest a partially transparent buffer, but I see why you want to do this cartographically. This could be slow, and you need to manually decide where you want the labels to ...
user avatar
  • 19.8k
16 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. ...
user avatar
  • 4,224
15 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' ...
user avatar
13 votes

Choosing only one contour line to label in QGIS?

In QGIS 2.6 (maybe earlier versions as well, I don't know) you can do this under the Layer Properties, Labels tab, Rendering section. About halfway down the list of rendering options is a button that ...
user avatar
  • 12k
13 votes

Choosing only one contour line to label in QGIS?

One approach would be to load the contour layer and style it. Then load the same layer again and apply a filter (right-click on the layer and go down to 'Filter..') Use a filter expression similar to ...
user avatar
  • 6,819
12 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/...
user avatar
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 ...
user avatar
  • 36.5k
11 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 ...
user avatar
  • 7,514
10 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 ...
user avatar
  • 4,762
9 votes

QGIS contours smoothing and cleaning

Sirgeo, don't try to fix up contours after they are generated, the processes take a long time and will eventually lead to intersecting contours = a nightmare! Instead smooth your raster to take the ...
user avatar
9 votes

Selecting contours which heights are integers?

Here is another query option. It largely does the same as the answers listed above but is (in my opinion) a little bit easier to customise for different scenarios. To display any contour divisible by ...
user avatar
  • 91
8 votes
Accepted

Generate multiple contour lines at specific elevations

You can specify levels using the GRASS module, r.contour.level. It's available in the processing toolbox. You can search for it when the dropdown at the bottom of the Processing Toolbox window is ...
user avatar
  • 1,191
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 ...
user avatar
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 ...
user avatar
8 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 ...
user avatar
  • 53.4k
7 votes

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

During my research to achieve a mostly dynamic labeling of contour lines in QGIS 3.10, I put everything together in a small cooking recipe and changed my original answer to share the findings with the ...
user avatar
  • 3,773
7 votes

How to create contour lines from point data using QGIS?

Using the Contour plugin. Generate isolines and/or filled contours a set of data points.
user avatar
  • 319
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 ...
user avatar
  • 3,807
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). ...
user avatar
  • 891
7 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 ...
user avatar
  • 29.2k
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 ...
user avatar
  • 383
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 (...
user avatar
  • 51.4k
6 votes

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

I think the closest it can get with current QGIS abilities is to use halo (or background) effect with color sourced from table which will be based on the elevation value and color scheme same as used ...
user avatar
  • 9,276
6 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 - ...
user avatar
  • 106
6 votes

Choosing only one contour line to label in QGIS?

I'm using this approach wich makes the labeling and display of contourlines by condition quite easy. I use the "Data defined properties" of the line symbol width and colors of the contourlines with ...
user avatar
  • 1,806
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 ...
user avatar
6 votes

How to calculate mean elevation in a DEM between a specific interval?

Set environment setting extent=your DEM extent, snap raster = DEM, cell size= one for DEM. Use raster calculator expression: Con("DEM">1500,"DEM) Right click on resulting raster, Source, scroll down ...
user avatar
  • 21.7k
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 ...
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 ...
user avatar
  • 48.7k
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 ...
user avatar
  • 2,218

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