Hot answers tagged

58 votes

Setting all pixels with value <= 0 to "nodata" in DEM raster

It can be done in one step in QGIS in the raster calculator. In QGIS3, for a raster layer named "x", use the following expression: (("x">0)*"x") / (("x">0)*1 + ("x"<=0)*0) This trick maps ...
Colin Stark's user avatar
30 votes

Generating equal sized polygons along line with PyQGIS

Interesting question! It's something I've wanted to try myself, so gave it a go. You can do this in PostGRES/POSTGIS with a function which generates a set of polygons. In my case, I have a table ...
Steven Kay's user avatar
  • 20.3k
22 votes

Setting all pixels with value <= 0 to "nodata" in DEM raster

You can also save the layer (right click, save as ...) and specify a nodata range. This will keep the original nodata and create new nodatas for the specified range of values.
Joost Beckers's user avatar
17 votes

Is there any way to include "universal" style/symbology in GeoPackage?

QGIS support its own format QML and SLD. When you use GeoPackage (or PostGIS) you can save the style on the GeoPackage and distribute both the data and the style. On the layer properties, the Style ...
jgrocha's user avatar
  • 5,290
13 votes

Generating equal sized polygons along line with PyQGIS

@Steven Kays's answer in PyQGIS. Just select the lines in your layer before running the script. The script does not support the linemerging so it can not work on layer with multilinestring #!python # ...
lejedi76's user avatar
  • 1,402
13 votes

GRASS and SAGA do not appear in QGIS processing toolbox?

Recently GRASS and SAGA integration system changed within QGIS. You must enable the SAGA and GRASS provider plugins to keep using the grass and saga tools.
wanderzen's user avatar
  • 2,110
11 votes

Generating equal sized polygons along line with PyQGIS

There is differents solutions. And this can work with simple polyline and multiple selected entities block diagram: Parameters select orientation for generation and read index (left-to-right, north-...
GeoStoneMarten's user avatar
10 votes

Legend of Flow Direction calculated with processing toolbox QGIS (SAGA)

SAGA's flow directions are coded from North = 0 : 7 0 1 6 2 5 4 3 Each GIS has its codification : for GRASS it's 3 2 1 4 8 5 6 7 and for ARcgis : http://desktop.arcgis.com/fr/arcmap/10.3/...
Christine's user avatar
  • 308
10 votes

No SAGA available in QGIS Processing

I had faced a similar issue but resolved it with saga install. You need to install proper version of SAGA. I installed saga via apt install. SAGA version in Ubuntu 18.04.3 repository work very well ...
programmer punk's user avatar
9 votes

Which SAGA versions does QGIS 2.18.10 support?

Due to how complex it was to manage multiple versions (and how fast and erraticly the SAGA API changes), it was decided to support a single version. SAGA 2.3 is supposed to be something like an LTR, ...
Victor Olaya's user avatar
8 votes
Accepted

Strange output from RSAGA topographic wetness index?

I think I see the problem. I could reproduce this, both using your script, and SAGA itself. The output from SAGA matches the output from your script. So it's not RSAGA. But look at the slope output ...
Steven Kay's user avatar
  • 20.3k
8 votes
Accepted

Replacing 0 values of a raster with values from another raster in QGIS?

Solution using SAGA Raster Calculator I performed a quick test and you should probably use this expression: ifelse(a=0,b,a) instead of the one you provided (also, choose 8 byte floating point number ...
mgri's user avatar
  • 16.1k
7 votes
Accepted

Least cost path between various points QGIS

Here is a script for GRASS GIS 7 I wrote for similar purpose. It takes as input map of vector points and uses r.walk to create cumulative cost surface and creates vector line (least cost path) between ...
Anna's user avatar
  • 876
7 votes

Enabling SAGA in QGIS?

On my installation of QGIS 3.10.4 on Ubuntu 20.04 I had to install SAGA manually via sudo apt install saga After restarting QGIS, SAGA was then listed in the processing toolbox.
Florian Brucker's user avatar
7 votes
Accepted

Getting Output names of Processing algorithms via PyQGIS

It may also depend on the algorithm. For example, the Ordinary Kriging from SAGA returns two outputs (VARIANCE and PREDICTION), but other SAGA algorithm outputs are called OUTPUT. So, you cannot just ...
Germán Carrillo's user avatar
7 votes
Accepted

Compute flow accumulation only from flow direction?

The following is a step-by-step process for how to take an ArcGIS D8 flow direction raster and use it to perform a D8 flow accumulation operation in Whitebox Geospatial Analysis Tools. I will preface ...
WhiteboxDev's user avatar
7 votes

Prevent SAGA in QGIS 3.0 from creating certain outputs?

Should be possible to do if you feel like hacking your qgis install. look for this file in your qgis install: https://github.com/qgis/QGIS/blob/master/python/plugins/processing/algs/saga/description/...
ndawson's user avatar
  • 27.6k
7 votes

Ubuntu 20.04 with QGIS 3.14 (pi) SAGA is missing

In order to solve the problem I had to: Verify if SAGA is actually installed in the system with: saga_cmd It said SAGA was not installed. Install SAGA with: sudo apt-get install saga Check it's ...
Abs's user avatar
  • 111
6 votes

Splitting shapefile into separate files for each feature using QGIS or SAGA

Use 'Split Vector Layer' in the Vector General Toolbox This tool will allow you to split a vector layer based on an attribute column. It splits the data into separate shapefiles for each unique ...
jbalk's user avatar
  • 7,485
6 votes

gdal doesn't support *XYZ-file

GDAL's XYZ driver is not particularly robust (e.g. "Ungridded dataset: At line 3, change of Y direction" with a perfectly gridded dataset), so here are a few alternative methods that should ...
Mike T's user avatar
  • 42k
6 votes
Accepted

SAGA tools in QGIS only allow save as .sdat file?

It seems that you are correct, SAGA tools in processing always output grids as SDAT format or a temporary file. If you really need a TIFF file as a final output (you can use SDAT in other processing ...
Alexandre Neto's user avatar
6 votes
Accepted

SAGA GIS raster calculator - QGIS scripting gt expression

processing.runalg('saga:rastercalculator', raster,[],'A>0',False,7,OutRaster) Explanation 'saga:rastercalculator' Calls the algorithm. raster Your input raster [] Additional input rasters as ...
Phil G's user avatar
  • 713
6 votes

How to configure QGIS (SAGA, GRASS algorithms) in Ubuntu

You have not to configure anything like you do in windows. After you have installed Qgis: for GRASS you have to install the software in this way (link to official page): sudo add-apt-repository ppa:...
CaMa's user avatar
  • 118
6 votes

Set path to SAGA from QGIS on OSX

Your main problem is that the SAGA version you have installed (5.0.0) as shown in your screen shot, is not supported. As of (I think) QGIS 2.18, only the SAGA Long Term Release (currently 2.3.2) is ...
Ben W's user avatar
  • 21.2k
6 votes
Accepted

No SAGA available in QGIS Processing

In QGIS 3.4, the SAGA provider is already a core plugin. Therefore, you can also change the SagaAlgorithmProvider.py file directly, by: sudo nano /usr/share/qgis/python/plugins/processing/algs/saga/...
Fee's user avatar
  • 1,160
6 votes
Accepted

Raster normalization

I think the SAGA Description file for Raster normalization tool is not properly configured. (Each Description file defines the UI settings of SAGA tool in QGIS processing environment). Based on QGIS 3....
Kazuhito's user avatar
  • 30.7k
5 votes

SAGA raster calculator, ifelse command syntax problem?

lt(a,10) returns 1.0 if a < 10 is true (else 0.0). You can use either ifelse() or lt(), but not together. ifelse(a < 10, a, 0) and lt(a, 10) * a will both work. Note: a and g1 both means ...
Kazuhito's user avatar
  • 30.7k
5 votes

QGIS cluster gdal Unknown option 'INTERPOL'

I guess I found an ugly side of free software here. One side, qgis programers really knows this problem since 10 months ago. They dicieded it is not their responsability to solve this problem and I ...
jlopez's user avatar
  • 297
5 votes
Accepted

QGIS- extract raster information into a point return nulls

Point sampling tool works perfectly if the spatial reference (projection) of the raster data and the point shapefile are same. Working with different projections for the raster(s) and shapefile data ...
ahmadhanb's user avatar
  • 40.7k
5 votes

Why does saving a big Shapefile take so long?

Old question.... but I had same issue in QGIS 3 with almost one million points in a shape file. Saving as Geopackage instead solved the problem - saving took like 30 seconds.
Morten's user avatar
  • 173

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