Questions tagged [qgis-processing]

Spatial data processing framework that brings advanced analysis capabilities to QGIS.

Filter by
Sorted by
Tagged with
2 votes
1 answer
44 views

QGIS does not load Processing algorithm's (raster) output

I wrote a simple QGIS Processing algorithm: from qgis.core import QgsProcessing from qgis.processing import alg import processing @alg(name="test", label=alg.tr("test"), group=&...
  • 9,877
1 vote
1 answer
20 views

Child algorithm in custom Processing algorithm fails to find temporary output of previous child algorithm

I wrote a simple custom QGIS Processing algorithm in Python: from qgis.core import QgsProcessing from qgis.processing import alg import processing @alg(name="test", label=alg.tr("test&...
  • 9,877
4 votes
1 answer
41 views

For QGIS processing algorithm python scripts, how to limit selectable layers in algorithm input when using @alg decorators

When using the @alg decorator to scaffold a processing algorithm, we use the @alg.input to declare new widgets for the interface. We can declare these as alg.SOURCE for layers we use in the algorithm. ...
0 votes
0 answers
19 views

Create a regression model from a mixture of polygon, line and point data [closed]

I've decided for a school project that I will use a regression analysis to predict the location of new shops (dependent variable) based on a number of independent variables. I have point files for the ...
1 vote
0 answers
33 views

Group by multiple columns in QGIS array

I'm looking to create a figure with multiple rule-based symbologies. A graduated range within a category within a main category. The only way I think that's possible is by adding categories, ranges to ...
2 votes
1 answer
34 views

QGIS Modeler - cannot use aggregate function in this context?

I am using QGIS 3.22 and I am making some algorithm in Modeler I am using Vector Layer as layer and Vector Field as field (it is field with real values and nulls). I want to add column with sum of ...
1 vote
0 answers
20 views

QGIS model designer, get output value

I am developing a model, will go through different steps of calculation to create new field using @field calculator algorithm which can generate a layer as output. . One of my calculations is to ...
0 votes
0 answers
21 views

CSV location code decoder

Is the a way reverse a CSV cell code that was generated from PyQGIS? This is for a location point. The code is 0101000020E6100000C5DC58CD04F65BC0CC755D611AB54040
-1 votes
0 answers
32 views

Filling polygon with rectangles / boxes

How can I fill a polygon with X/Y rectangle polygons up to a given maximum area size? Maximum size given as otherwise the number of resulting boxes will be infinite along the edges of course. For ...
  • 71
1 vote
1 answer
44 views

Adding script to the Processing Toolbox in QGIS

I have a script and I would like to add it to the processing toolbox via Add Script to Toolbox using the Python icon. I received this error and I could not add my script to the processing toolbox. The ...
0 votes
0 answers
37 views

QGIS Python name 'processing' is not defined

Some time ago, I did the following script for retrieving vegetation indices from raster images. Apparently, the new Python version is not allowing running the script. The script is made to have a QGIS ...
  • 487
1 vote
0 answers
30 views

Expression syntax using processing.run algorithms in PyQGIS

I am trying to run "Extract by expression" in a QGIS script using processing.run layer1 = points.shp processing.run( 'qgis:extractbyexpression', { 'EXPRESSION': "...
0 votes
0 answers
13 views

QgsRasterCalculator doesn't allow me to perform more actions in QGIS after run it

I am trying to use QgsRasterCalculator for a simple equation: co = mo * 0.58 This is the code: # -*- coding: iso-8859-15 -*- import processing import os from qgis.core import * GUIEnabled = ...
0 votes
0 answers
41 views

How to merge selected polygons with all adjacent polygons individually?

I have a vector layer with polygons representing administrative districts of germany. For every polygon smaller than 500 km² I would like to create bigger polygons by merging each of the small ...
  • 13
3 votes
0 answers
28 views

How to specify GDAL driver to use for Processing INPUT?

How can I specify a specific driver to be used by GDAL/OGR when running a tool via Processing? GDAL/OGR calls them prefixes to the connection string, e.g. https://gdal.org/drivers/vector/gmlas.html#...
  • 9,877
1 vote
1 answer
97 views

PyQGIS, custom processing algorithm: How to use selected features only?

I want to create a custom processing algorithm with PyQGIS, which is able to take a vector layer as input (in this case of type point) and then do something with it's features. It's working well as ...
  • 19
0 votes
0 answers
22 views

Error in LAERS parameter in processing.run in qgis3.28 while writing standalone python script

I am trying to download google satellite images in ".tif" form by qgis3.28 My code is as following import requests from qgis.core import QgsApplication, QgsRasterLayer, QgsMapLayer from qgis ...
3 votes
2 answers
183 views

Generating points along the line at equal intervals excluding vertices in QGIS

I want to generate points along a line at equal intervals but the final point layer should not contain the vertices points. It should only contain points at specified intervals. Tools in QGIS such as &...
  • 31
0 votes
0 answers
63 views

Unable to run SAGA-Terrain Analysis-Fill sinks (wang&liu)

I am trying to do a Watershed analysis using QGIS. However if I want to run the SAGA function Fill sinks (Wang & Liu) I get an error that the 3 files were not created (full error down below). I ...
0 votes
1 answer
60 views

Select Polygons in layer A with a specific geolocation criteria in relation to each other and layer B

I am trying to select Polygons from Layer A with the following rules: Polygon in Layer A is smaller than 1 ha and further than 100 m from any other polygon in either Layer A or B that is greater than ...
  • 9
1 vote
1 answer
46 views

Specifying the raster layer name in processing qgis:rastercalculator

I have a QgsRasterLayer and want to process it in a processing script with qgis:rastercalculator. How can I customize the name under which the layer is referenced in the expression? It seems that QGIS ...
  • 9,877
1 vote
0 answers
42 views

QGIS 'Packing Problem'?

I have 45 irregular polygons (geographic areas) of various sizes. I need to grid each one into a universal number of same-sized squares/rectangles (same sized within each polygon, not necessarily ...
2 votes
1 answer
51 views

How do I convert a PyQGIS script to a processing tool with user input?

My code selects points in a layer by date and creates a new layer from them. I want to make this a processing tool where the user can choose the date and run the script. I'm brand new to QGIS, but I'...
  • 95
1 vote
1 answer
44 views

Running qgis_process from Linux terminal

I am currently working with coordinate data that I cannot take off of a remote server and I need to run QGIS processes on this data. However, in downloading QGIS 3.18.3 onto the remote machine through ...
  • 11
1 vote
1 answer
41 views

processing.createAlgorithmDialog not filling default enum parameter

not sure if this is the expected behavior of the QgsProcessingParameterEnum. I have a very very example Processing script. Not doing anything in the processAlgorithm method because I'm focused on the ...
  • 3,114
0 votes
0 answers
40 views

Error in Clipping Polygon

I tried Clipping my polygon after union but it gave me this error: QGIS version: 3.26.0-Buenos Aires QGIS code revision: 0aece2818e Qt version: 5.15.3 Python version: 3.9.5 GDAL version: 3.5.0 GEOS ...
  • 95
1 vote
2 answers
66 views

Adding ToolButton Merge Selected Features to plugin

I've created my own plugin which also includes Standard QGIS-ToolButtons. I've been trying to add the "Merge Selected Features" (Advanced Digitize Tool Bar) Tool into my Plugin. How do I ...
0 votes
0 answers
70 views

QGIS 3.22 does not display Google Earth after added as a XYZ tile

I am new to QGIS, I need to add Google Earth as an XYZ tile, I did this by clicking it, then hitting new connection then using the Google Earth link, and hitting okay. I then tried to view it but it ...
0 votes
0 answers
18 views

Excluding fields from alg.FIELD

Is it possible to exclude some fields from showing in processing algorithm's interface ? @alg.input(type=alg.SOURCE, name="INPUT", label="my_layer") @alg.input( type=alg....
  • 564
2 votes
1 answer
65 views

Get access to QgsProcessingAlgorithmDialogBase methods and attributes from within QgsProcessingAlgorithm

I was wondering if there is a simple method to have access to methods and attributes of the QgsProcessingAlgorithmDialogBase class from within a Processing script. I can do it from outside, creating ...
  • 3,114
3 votes
2 answers
130 views

Making dissolve output as temporary layer using PyQGIS

I want to dissolve my layer by using this script and it is successful, however I want my dissolved layer to be temporary, and my input as any active layer. Can someone help me? from qgis import ...
  • 95
2 votes
1 answer
49 views

QgsProcessingParameterEnum check all option by default

I'm building a Processing script with some QgsProcessingParameterEnum parameters that accept multiple values. I cannot find an option to have by default all the options checked when opening the dialog ...
  • 3,114
4 votes
1 answer
89 views

Change the symbology of a vector output layer that is returned from a processing tool?

I want to change the symbology of a Vector Output Layer that is Returned after running a Processing Tool. I am building a processing plugin. I am trying to make the effects reflect in the displayed ...
3 votes
1 answer
231 views

QGIS 3.16, 3.22. SAGA tools not working. ERROR: Loading resulting layers The following layers were not correctly generated

I've tried multiple SAGA processing tools (Tools tried include: "clip raster with polygon". "Fill sinks Fill sinks (Wang and Liu)". "Polygon Centroids.". It seems that ...
  • 41
1 vote
0 answers
19 views

QGIS Modeller- PostgreSQL execute and load- prevent layers being added to map?

I have a model which loads a bunch of PostGIS layers, does some processing, then adds the styled output to the map. A side effect of the 'PostgreSQL execute and load' algorithm is that it loads those ...
  • 340
1 vote
1 answer
56 views

QGIS: Preserving the band values in Hillshade

I used Raster -> Analysis -> Hillshade without changing any default values and I realised that the elevation data has changed from actual metres to 1 to 255: Is it possible to preserve the ...
  • 209
0 votes
0 answers
22 views

Getting wrong coordinate system with $y function [duplicate]

I have a shapefile that I need to add Lat Lon attributes to attribute table. I am using the $y but the number I get is not from the correct coordinate system I want. I have changed the coordinate ...
3 votes
2 answers
102 views

Include the processing tool "exporttospreadsheet" into my plugin

I made a Plugin containing features for a specific workflow. As the last function I wanted to add the qgis processing tool "ExportToSpreadsheet" (Layertool) into my plugin. It's a native ...
0 votes
1 answer
35 views

Convert smoothened contour in QGIS ( vector) to raster for use in HECRAS

I have generated contours in QGIS using point data (AutoCAD file) and I had to also smoothen the contours and remove noises (smaller contours) from the contour generated. I need to get this contour ...
  • 105
8 votes
1 answer
393 views

Avoiding too curly contours in QGIS

I had point data in DXF and generated contours using QGIS. The contours had smaller islands and the contours in itself are too curly. I smoothed the contours too and I could avoid that unwanted island ...
  • 105
0 votes
0 answers
89 views

Support Vector Machine (SVM) using QGIS

I want to classify Sentinel-2 images using QGIS and SVM. Please provide me with guidelines/instructions or a video tutorial link. I'm new to QGIS. I observed that there are numerous videos for SVM ...
1 vote
1 answer
170 views

QGIS crashes when using "Split with lines" tool

I want to use the "Split with line" tool on a dataset with 5000 line features. It works if I select some of the lines, but on the whole dataset, it crashes. Is there a way to solve/work ...
0 votes
0 answers
21 views

QGIS: Group together polygon overlaps

I have a point layer with 400 locations. See the following fictituous sample. Here is the process of getting the below table: Import CSV to get points and assocated ID Create radii per row using ...
1 vote
1 answer
68 views

How to add a column in one shapefile that is the sum of values in another shapefile?

I am trying to calculate a weighted average CN value for 500 drainage area catchments (S1-S500). I have one file named "DA" which has S1-S500. Name Total_Area S1 1.5 S2 0.8 ........
0 votes
0 answers
16 views

Setting a default value for reference layer - QgsProcessingParameterMultipleLayers

I want to have a default selected layer when running a processing algorithm. (QgsProcessingParameterMultipleLayers). At the moment I can achieve that by adding the defaultValue argument in ...
  • 233
1 vote
0 answers
35 views

QGIS model builder: Export model to pyqgis and add some more processing steps

I have set up a processing model with the QGIS model builder. I want this model now as python script to hardcode some of the inputs (so the client does not have to select dozens of input layers each ...
  • 2,486
2 votes
1 answer
47 views

Layer not visible under Raster Calculator but visible in the Tree Panel

I have one raster layer(generated inside a plugin) visible under the Tree layers panel and on the canvas but not in the Raster Calculator processing tool. I can replicate the same behavior with the ...
  • 233
1 vote
1 answer
47 views

Displaying water movement paths over grid in QGIS

I have an external .csv file with "From" cell, "To" cell, X, Y coordinates for the "From" cell, X Y coordinates for "To" cell and flow rate for water going from ...
0 votes
0 answers
62 views

Creating unique ID for overlapping polygons in QGIS

In QGIS I created a union from a layer that had a lot of overlapping polygons. In the union layer, I used the Field Calculator (see the formula I used below) to count how many overlaps there were, as ...
0 votes
0 answers
33 views

Matching lower level shapefiles with higher level shapefiles

I was trying to combine two shapefiles with different levels of administrative units. when I run it, it is showing error like this. Feature (344) from “Sector_Boundary_2006” has invalid geometry. ...

1
2 3 4 5
31