26
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 ...
17
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.
...
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' ...
14
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). ...
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/...
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 ...
11
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 ...
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 ...
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 ...
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 ...
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 - ...
8
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 ...
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 ...
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 ...
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 ...
8
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 ...
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 ...
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).
...
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 ...
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 ...
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 (...
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 ...
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 ...
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 ...
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 ...
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
...
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 ...
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 ...
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
contour × 531qgis × 245
arcgis-desktop × 98
dem × 97
raster × 43
elevation × 43
labeling × 28
arcmap × 26
interpolation × 22
line × 21
gdal-contour × 21
gdal × 20
vector × 19
shapefile × 18
grass-gis × 18
polygon × 16
qgis-3 × 14
lidar × 14
bathymetry × 13
python × 12
postgis × 12
arcgis-10.1 × 12
qgis-plugins × 12
heat-map × 11
terrain × 11