Questions tagged [qgis-processing]

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

Filter by
Sorted by
Tagged with
4
votes
1answer
49 views

'Evaluation error' when using Aggregate tool in QGIS

In QGIS 3.16. I am using the Aggregate function to reduce the number of features in a layer. I am grouping by one field and I want to concatenate the others. My actual data table is fairly large and ...
1
vote
1answer
38 views

Load vector layers from PostGIS with a processing script

I'm trying to build a processing script to automatize the loading of specific vector layers from postgis db. I wrote the following code lines which worked fine in python console : tablename = "...
4
votes
2answers
94 views

AttributeError when counting entity number using PyQGIS

I'm trying to count the number of entities but each time I have this error: `AttributeError: 'dict' object has no attribute 'featureCount' while I have only one selected layer uri = r"C:\...
1
vote
1answer
15 views

Add points to a polygon based on polygon data

Im working with QGIS 3.x, and i have a polygon layer, and each polygon has a value. i want create a point layer (like random points) but based on each polygon value. For example: polygon 1 value = 3 ...
1
vote
0answers
22 views

I need to speed up my code and change it from this form to be used as algorithm

I am relatively new in PyQGIS and working with vector layers. I have three layers (point, polygon and lines). I need to check if line can have intersection with polygons (Either it has now, or could ...
1
vote
1answer
20 views

Running a tool on subset of layer two points at a time PyQGIS

layer = iface.activeLayer() request = QgsFeatureRequest() request.setLimit(2) request.setFilterFids([1, 2]) for feature in layer.getFeatures(request): print([f for f in feature]) params = { '-g' ...
0
votes
0answers
14 views

Error _core.QgsProcessingException with qgis:rastercalculator

I'm trying to increase the cellsize of an input raster using the processing algorithm qgis:rastercalculator but always get the error ProcessingException. I think there's something wrong with the input/...
1
vote
0answers
55 views

Missing optional dependency 'tables' in QGIS

When we run a Python script as an action in QGIS, we get an error as shown below. Traceback (most recent call last): File "", line 17, in File "C:\PROGRA~1\QGIS3~1.16\apps\Python37\...
4
votes
2answers
60 views

PyQGIS Output leads to invisible layers that don't appear in the layer panel or the canvas but can be accessed in Vector tools

I'm working on a Processing Tool in PyQGIS and am struggling with the problem described in the title. Layers are not visible in the "Layers Panel" or on the canvas but can be chosen and ...
3
votes
1answer
41 views

Using shortestpathpointtopoint tool with PyQGIS

I am a total beginner with Python and programming in GIS in general. I have point data and I want to compare in which month people walked the longest distance. It is a relative large dataset and I ...
0
votes
0answers
8 views

Cannot provide inputs for saga:difference using qgis_process-qgis (command line qgis)

I'm using the following command to find the difference between two Sentinel 2 rasters using saga:difference tool in Powershell (works fine in standard QGIS3): ./qgis_process-qgis run saga:difference --...
5
votes
0answers
47 views

Using flags in new-style QGIS Processing Algorithms

In QGIS 3.6+, there are two different ways to construct a Processing Algorithm. Defining a class inherited from QgsProcessingAlgorithm. In this case, I can define flags for an algorithm as follows: ...
2
votes
0answers
64 views

QGIS processing algorithm - add saved geopackage layer to map

I am still new to Qgis and Python and most likely this is really simple but however I do not manage to do the following: I am trying to write a python processing algorithm for the processing toolbox. ...
0
votes
0answers
24 views

PyQGIS path error when in loop

I have a very simple script which takes in table of X,Y --> Convert to point --> Convert to Shape centerpoint = r'C:/Users/YYY/pointfile.xlsx|layername=Sheet1' pointshape = r'C:/Users/YYY/...
4
votes
1answer
56 views

Selecting the transect lines which touches the divide of a polygon from the river line

I have a polygon and transect lines which passes inside the polygon. Here I want to select the lines which touch the drainage and divide. The transect lines split at the river intersection. Since ...
1
vote
1answer
42 views

Iteration over features in PyQGIS processing modules

I have an issue with processing.run commands where I would like to do an iteration over features in a layer with polygons. zsj = QgsVectorLayer("/data/grassmaster/testVlado/zsj_ba_test.gpkg",...
3
votes
1answer
35 views

How do I automatically remove the lines across the midrib which a river doesn't overlap?

I have a river line, mid-rib and transect line I am trying to get a transect line by keeping mid-rib as the reference and I need to include only the transect lines that overlap the river. Just like ...
1
vote
0answers
13 views

Calling qgis:postgisexecuteandloadsql from standalone script. DataItemProvider is empty

I'm trying to execute sql and load layer from script. whcih works fine with qgis python console but standalone script fails. There may be a proper way to initialize postgresql db settings but so far I ...
0
votes
1answer
13 views

R scripts in QGIS : Get input vector layer path

When running R scripts in QGIS, upon loading my vector layer with ##Layer=vector it automatically runs Layer <- st_read("path/to/shape.shp", quiet = True, stringsAsFactors = FALSE) on my ...
1
vote
2answers
40 views

Move moved long and lat to their own position

I have a dataset with point that have fields containing latitude and longitude. I have displaced some points (up to 2 mts) and saved the modification. The field containing the original lat long in the ...
0
votes
0answers
19 views

Unable to join data by field value

i have a dataset which contain object_id, poi_x and poi_y and another data set with same object_ids but different poi_x and poi_y. i want to join poi_x and poi_y from second dataset to first dataset. ...
1
vote
1answer
27 views

Keep RGL window open after R QGIS script finishes

I'm using the 'Processing R Provider' plugin to run some R code that uses the lidR package. It's working fine except, when the script finishes, the RGL window that displays the 3D plots closes. I was ...
2
votes
0answers
23 views

Parallel lines not showing on my map document (QGIS; v.parallel function)

Weird issue: I am trying to use v.parallel to draw a line parallel to a single line layer I have. It processes without issue, but the parallel line does not appear on the map. The curious thing is ...
2
votes
1answer
33 views

What type of object QGIS native:mergevectorlayers accepts for LAYER parameter?

Here is part of the code which I am using: from qgis.processing import alg from qgis.core import * import processing @alg(name="ex_new", label=alg.tr("Example script (new style)"),...
0
votes
0answers
32 views

QGIS find steepest path on a DEM [Path of a drop of water]

Is there an algorithm or plugin in QGIS to find the steepest path on a DEM given a point (the path followed by a drop of water)?
1
vote
0answers
32 views

Hiding / encrypting password in QGIS processing script

Is it possible to hide or encrypt password in QGIS processing script? For example, hide password for PostgreSQL connection. QGIS "Master password" is possible, but I need a solution for code ...
2
votes
0answers
21 views

Creating Standard Deviation Index (SDI) cell by cell in DEM

I am fairly new to QGIS and have been struggling to find a solution. To put it simply I am trying to find a way to display the Standard Deviation Index on individual cell basis by comparing it to its ...
5
votes
3answers
134 views

Creating a fixed length segment of a line around a point on line

I've a layer of rivers as lines, splitted in segments by their size. I've created random points on those lines and selected some of them - 90 in total. I'd like to take those selected points on lines, ...
3
votes
1answer
151 views

QGIS low CPU usage why?

I work with the latest QGIS program on bike trail maps. I monitor my CPU and memory usage and for years the CPU usage hovers around 20%, never to peak or even hit 50%. This just seems odd that I have ...
1
vote
0answers
65 views

Get source and output paths in QGIS 3 processing algorithm [duplicate]

How can I find the complete path of the INPUT (r_in_name) and OUTPUT (r_out_name) rasters for the gdal datasets in the following code: from qgis.processing import alg from qgis.core import QgsFeature, ...
2
votes
2answers
95 views

Use an attribute value as parameter of next tool in QGIS modeler

I am building a model where I need to use an attribute value as parameter in the next tool. I include an illustration that will hopefully make the problem clearer. So far I have been unable to ...
2
votes
1answer
65 views

Creating Buffer based on Field attribute value in QGIS Modeler

Working under QGIS 3.16.4 and using the Modeler, I would like to create buffers for a polygons layer. The polygons layer includes the buffer size as an attribute (e.g. "BUFFER_M") resulting ...
0
votes
0answers
15 views

QGIS - Topological colour doesn't add new layer

I have been reading the "Handling Invalid Geometries" topic in the QGIS Tutorials & Tips section, to which the link you can find here: https://www.qgistutorials.com/en/docs/3/...
0
votes
0answers
36 views

Multiplying rasters in standalone PyQGIS

I'm trying to multiply some rasters in a standalone python environment. I have done it successfully in the QGIS python environment, and manually in QGIS, but when I run the following code, nothing ...
0
votes
1answer
14 views

OpenWind Unable to open polygon shp files from QGIS

I have a set of interlinked lines shp files which i imported to QGIS and add a fixed buffered zone via vector processing function on QGIS 3.10. I saved the scratch layer and toggled edit off on ...
0
votes
0answers
24 views

QGIS 3.10.4-A Coruña processing.run overload?

I have a command block with multiple run.processing commands (gdal:clipvectorbyextent, grass7:v.transform, native:dissolve) in a loop for in PyQGIS. Everything is fine at first, after executing a for ...
1
vote
0answers
24 views

Why do R scripts not show up amongst the Providers in QGIS3.18?

I have installed the Resource Sharing plugin (3.18) and have installed the QGIS R script collection as instructed elsewhere. Why do the R scripts not now show up among the Providers or in the ...
0
votes
0answers
23 views

Native algorithms not available in standalone QGIS when 3rd party algorithms are working [duplicate]

I'm writing some standalone python code (in Spyder) to automate QGIS work. I am successfully using 3rd party algorithms, having performed the following setup: #initialise qgis qgishome = 'C:/Program ...
3
votes
0answers
52 views

qgis_process run script from command line

qgis_process allows us to run scripts already installed in QGIS from the command line. But is there a way to run qgis scripts not yet installed? e.g. if I have a file script.py from qgis.core import ...
0
votes
1answer
23 views

Export a raster from a WMS layer in QGIS Graphical Modeller

I would like to be able to export a section of a WMS to a georeferenced image using the graphical modeller. I already have the extent setup for other things but I can't find an algorithm that will ...
4
votes
0answers
52 views

Changing feature attribute just after adding via QgsFeatureSink

How can I access a feature and change its attribute value, I just added to a processing-output before via sink.addFeature(feature, QgsFeatureSink.FastInsert)? Things like feature.id(specificfeatid)[...
0
votes
2answers
80 views

How to enable Python scripts in processing toolbox in QGIS 3.16

I'm not able to enable Python scripts in the processing toolbox. It should turn up in the toolbox (see the third screenshot). The Python logo is also missing from the toolbox. Is there something wrong ...
0
votes
2answers
39 views

QGIS v/s MapInfo - Differences in Distance Measurements

Distance calculated in different software (MapInfo and QGIS) has given me differences in distance values. To be more precise, it's mostly happening when the distance is more than 25 miles. I doubt ...
4
votes
0answers
44 views

Passing list as reclassify input table parameter in qgis.reclassifybytable algorithm

Following up on Save and load the classes definition table in the QGIS reclassify by table tool, I decided to run the qgis.reclassifybytable algorithm using PyQGIS to reclassify an aspect raster. Here'...
0
votes
0answers
39 views

Two Separate QGIS Plugins Under one Provider

I have developed a QGIS processing plugin that has a processing provider of its own. That plugin is working fine. Now I am developing a second plugin and I want to provide it the same provider so that ...
1
vote
1answer
61 views

Running 'r.null' processing algorithm in Standalone Python script on Windows

I want to run this code outside QGIS as a standalone Python script. import os import processing os.chdir('C:/Users/User/test/25') alg_params = { '-c' : False, '-f' : False, '-i' : False, '-n' : ...
0
votes
1answer
13 views

Export Data From Merged File to Individual

I Have a merged shape file with 'n' number of cities in it. Exporting them by selecting their names individually is a difficult thing and wasting my time. Is their any query in QGIS to export Data ...
1
vote
2answers
30 views

Deleting data by location using another shapefile

I have two shapefiles: one is main file and another is a part divided (manually by selecting) from the main file. Now i want to delete the divided part from the main file with the help of divided part....
0
votes
0answers
31 views

Running QGIS 3.1 Graphical Modeler Script as standalone

I have troubles running a Graphical Modeler Script as standalone via the OSGeo4W Shell console. Everything works fine when I run the script in QGIS. When I open it via shell, nothing happens. I think ...
2
votes
1answer
61 views

Merging two vector layers and removing overlaps in one step using PyQGIS

I have two overlapping polygon vector layers. I want to combine these two layers into one vector layer, but I don't want to keep overlaying parts - the blue layer is of higher importance (weight), so ...

1
2 3 4 5
26