Questions tagged [qgis-processing]

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

Filter by
Sorted by
Tagged with
1
vote
0answers
15 views

QGIS Python AttributeError: 'NoneType' object has no attribute 'processingRegistry'

I am executing a QGIS Desktop 3.8.3 Python 3 script. from osgeo import ogr, gdal from gdalconst import * from qgis.core import * import qgis.utils, sys from qgis.gui import * from PyQt5.QtGui ...
1
vote
1answer
18 views

QGIS - Translation problems

I've enabled Processing plugin and provided compiled i8n file but somehow there is a error which causes GUI to create two separate buttons. One of them is translated and one is not. Does anybody know ...
4
votes
1answer
56 views

Failure importing CSV file lines

I'm trying to import a CSV file in QGIS 3.4 using the common method of "Add Layer" > "Add Delimited Text Layer". But QGIS is reading every row of the dataset as a column title, and nothing is in a row ...
1
vote
0answers
31 views

Display labels set from within QgsProcessingAlgorithm in QGIS 3.x?

I'm writing a simple QgsProcessingAlgorithm and I need to set some labels (to display the azimuths of the sides of a polygon). I can set the labeling expression alright (the expression is properly set ...
1
vote
0answers
35 views

processing.runalg('qgis:splitvectorlayer') --> wrong Output directory

I'm tryiing to split a vector layer using this code : processing.runalg('qgis:splitvectorlayer', 'D:/Images_Sentinel_2/2A/shp_taitt/contour.shp', 'nom', 'D:/Images_Sentinel_2/2A/shp_taitt_split') ...
2
votes
0answers
30 views

QGIS 3 script new style more parameters

Since QGIS 3.6 there has been introduced a new script style. I am fairly new to this scripting and I would like to ask for the code to do an fix of two layers and after this to make an intersect of ...
1
vote
1answer
41 views

Reading source code of QGIS tool?

I can see the source code of the core QGIS plugins from the repository in github. I want to use the code snippets of "information about object" tool of QGIS. I tried searching in program files but I'm ...
1
vote
0answers
25 views

Suppressing Model-Dialog when running PyQGIS Script [closed]

I wrote a tiny script that has a fixed input and fixed output, i.e. I don't need any user interaction. However, when running my script the Model-dialog pops up although the script already ran. Is it ...
1
vote
1answer
35 views

QGIS 3.4.4 edit rendering styles for outputs - styles not loading

I have created a processing model in version 3.4.4 and I want the shapefile outputs from the model to load in a chosen style. I have saved the style files and used the 'edit rendering styles for ...
3
votes
0answers
50 views

No Vector Menu Available QGIS 3.4

I've installed QGIS 3.4 on my Mac. I don't have any vector or processing menu. In the "plugins" menu under settings, I have the following: "The settings on this tab are only applicable for Python ...
3
votes
1answer
59 views

Standalone Python application from QGIS graphical modeler

I am trying to run the script generated by my graphical modeller through QGIS script. But I get the following error. # Prepare the environment import sys from qgis.core import QgsApplication #from ...
1
vote
2answers
29 views

Launch bat. for QGIS 3 python not working

I'm trying to build a launch.bat for qgis 3 python. I would want to run python via batch file but I get an error 'no module named processing' Launch.bat: @ECHO OFF set OSGEO4W_ROOT=C:\OSGeo4W64 @...
0
votes
0answers
35 views

Distance matrix only for a specific rule [QGIS]

I am having a hard time using distance matrix vector tool in QGIS for a specific need. I know you need to have two different point layers in order to get a distance matrix, so far so good. But as I ...
2
votes
1answer
55 views

Comparing between layers name and merging layers having same name using PyQGIS?

I'm trying to write python script in QGIS to merge layers having the same name. To do that I specify the name of layer in the script, so all layers having this name, will be merged. However, since ...
3
votes
1answer
64 views

How to fix the error '_core.QgsProcessingException: There were errors executing the algorithm.'

I am trying to get the overlapping features between two layers in a loop. This works fine in most cases but raises an exception in some cases. The exception traceback does not even give any hint what ...
1
vote
0answers
36 views

Adding layers to project from a processing tool in QGIS3

I'm trying to add some layers created during a process to a project. There seems nothing to be added (TOC empty) but when I close QGIS It says: This project includes one or more layers as ...
-1
votes
1answer
37 views

Why my Geoprocessing tools was lost

How can I bring up my Geoprocessing tools again?
2
votes
1answer
46 views

Standalone PyQGIS file lock

I have a simple script for processing thousands of rasters/shapefiles. i am not able to delete temporary files, which are created by processing. I can pass them to: 'memory:output_file' but not for ...
1
vote
0answers
28 views

Writing new image file with PyQGIS

I would like to know how to transform the following code in something that only uses PyQGIS. I haven't found an example showing how to create raster files with PyQGIS yet. I'm making a processing ...
2
votes
1answer
65 views

Using processing toolbox conditionally in QGIS?

I want to be able to run the 'split with lines' function, but only on polygons where the area > determined value. Is it possible to do this simply, ie running a process from the processing toolbox ...
2
votes
1answer
32 views

Use PostGIS table in QGIS modeller

I have created a model in QGIS that uses data to create a set of tables in PostgreSQL via the "Export to PostgreSQL" process Is there a processing command that will allow me to access these tables as ...
1
vote
0answers
53 views

QgsVectorLayer.IsValid() always returns False?

I'm writing a standalone Python script which involves some geoprocessing using qgis libs. Unfortunetely, I couldn't manage to properly instantiate a vector layer - every time i run .isValid() on ...
1
vote
0answers
52 views

Unable to load layers created with Processing Toolbox PyQGIS 3

I figured out that besides from the python editor within QGIS, the layers that I'm creating with a Processing Toolbox are not saved and displayed in my .qgs projects. --> see image: 1) what I get ...
1
vote
1answer
45 views

Polygonize each object in layer individually (QGIS)

Running the polygonize algorithm from the processing toolbox doesn't seem to work if you have a layer with several line objects that you want to polygonize individually. Think two "polygons-to-be" ...
2
votes
1answer
36 views

PyQGIS/PlugIn: How do I pre-check if processing function is executable before I get a QGIS critical error?

I built a PlugIn with the 'native:shortestpathpointtopoint' tool to find the shortest path between two points on a multipolyline. When I run the Plugin I want to get a message with information about ...
1
vote
1answer
68 views

How to rename the result of a QGIS Processing Algorithm

When calling a QgsAlgorithm from within another, the result will be named after this algorithm output regardless of what is setup as the output of the main one. For instance, taking the code from ...
3
votes
2answers
62 views

Extracting or categorizing shared boundaries of polygons QGIS

I would like to recreate the style in this Wikipedia Locator map, where there are three distinct styles for boundaries: Coastline (thin blue line) High-level administrative land-border (thick grey ...
1
vote
0answers
17 views

Raster Calculator in the Graphical Modeler of QGIS 2.18

How to convert this expression from raster calculator ("noise_heatmap_clip@1" <= 50) * 5 + ("noise_heatmap_clip@1" > 50 AND "noise_heatmap_clip@1" <= 100) * 4 + ("noise_heatmap_clip@1" > ...
2
votes
0answers
63 views

Slow counting of points in polygon in QGIS 3.4

I am working on a plugin to count the point in polygons by PyQGIS in QGIS 3.4, and I found that compared to the same function in QGIS 2.18, it is very slow. I do not know the reason. My code is listed ...
1
vote
1answer
65 views

Script Works in Console but not in QGIS Script Editor

I've recently started working with Python in QGIS and I've been trying to make a script that dissolves a polygon layer and saves the output in the same folder as the input, something I believe isn't ...
2
votes
1answer
63 views

Split shapefile features and transpose attributes

QGIS v3.4 I have a single shapefile layer with overlapping features. I wish to intersect the features against themselves and transpose the summary of attributes in the output. The image below will ...
3
votes
1answer
98 views

Thread safe method to create print layout from within a processing script in QGIS

I have a PyQGIS script, which dynamically creates a print layout and opens it in the layout designer, when finished (example below). It works without problems when executed from the console. Now I ...
2
votes
1answer
79 views

Adding values to field using PyQGIS?

I would like to do a very simple task: (1) Add a field to a layer and (2) add some values to the field. I have ADDED A FIELD TO A LAYER by the following code and created three new fields: Dev_site, ...
5
votes
2answers
196 views

No output in PyQGIS standalone script running Distance Matrix?

I am trying to create a standalone PyQGIS script which runs the Distance Matrix in QGIS 3, see below: ######### INITIALISE QGIS STANDALONE ################ import sys from qgis.core import ( ...
1
vote
1answer
22 views

Specifying the parameters for processing function qgis:joinattributestable with PyQGIS-3

I would like to join a CSV and a vector layer, based on a field. I know I can handle this with multiple lines like in first part of https://www.qgistutorials.com/en/docs/performing_table_joins_pyqgis....
1
vote
0answers
55 views

Unable to execute any processing tool in QGIS [closed]

I am new to QGIS and want to learn some basic tools. However, after software installation I cannot execute any tool from the processing toolbox. All the tools is giving me the same error: The ...
2
votes
1answer
31 views

QGIS point array in JSON format to polygon

I have a CSV file with one of the columns containing an array of consecutive lat/longs like the following: "AK_BROOKSCAMP_2012": [[58.5729804, -155.8339805], [58.5641527, -155.8332666], [58....
1
vote
2answers
95 views

Algorithm not found by PyQGIS?

I have troubles using PyQgis processing module with QGIS 3.8. For example, I can reproject a layer with QGIS graphic interface, but when using PyQgis processing module through the following script : ...
2
votes
1answer
62 views

QGIS processing.run() standalone script does not write .prj and .cpg output files of shapefile?

I've created a python standalone script to clip two shapefiles with qgis. I've installed qgis3 with OSgeo4W. The logic is as follows: import qgis from qgis.core import * from qgis.core import ...
2
votes
1answer
35 views

Saving Output of Algorithm using PyQGIS?

I'm new to PyQGIS and trying to save the output of the processing tool 'create points layer from table'. I just need to save it as a shapefile. My code is below which seems to be functioning so far. ...
1
vote
1answer
49 views

Process PyQGIS 3.8 qgis:zonalstatistics and save output to CSV without geometry

processing.algorithmHelp('qgis:zonalstatistics') prints out: ---------------- Outputs ---------------- INPUT_VECTOR: <QgsProcessingOutputVectorLayer> Zonal statistics but I'd like to ...
1
vote
2answers
139 views

QGIS Field Calculator Aggregation with a intersect query

I have point (manholes) and line (sewer main) datasets and want attributes from the points at both ends of the line. If I run the following after I install RefFunctions in field calc on the line ...
1
vote
2answers
57 views

Lines will not stop curving, can't draw a straight line

I am new to QGIS and I realize this is probably a really silly question but I am at my wits end I've been trying to solve this for hours. I need to make a simple line layer to represent the sewer ...
0
votes
0answers
23 views

Load Vector Layer from table using processing in QGIS3

I am trying to turn a CSV of data into a shapefile using processing. mStasIn = "C:\GIS_Abschluss\AirData\MeasurementStations.csv" mStasOut = "C:\GIS_Abschluss\AirData\MeasurementStations.shp" mStas =...
1
vote
1answer
36 views

PyQGIS QgsProcessingAlgorithm: no output layer when cancelled

For one plugin I maintain, I can't figure out how to return output layer when the user hits 'Cancel'. Basically I'm looping over a set of results in processAlgorithm which populates the output layer ...
0
votes
0answers
38 views

QGIS - Get a parameter enum [QgsProcessingParameterEnum] list to update another parameter enum once the user selects them [duplicate]

I have a QGIS (v3.8) processing python script that has 3 lists I'd like to filter dynamically off each other upon a user selection. How can I get a parameter enum [QgsProcessingParameterEnum] ...
2
votes
1answer
78 views

Adding new attribute field to processing output algorithm in PyQGIS?

I have a processing script that will carry out a selection by expression of the input layer, then do a join attributes by location with a join layer. The next stage will be to add a new field and ...
3
votes
0answers
40 views

Pyqgis: Added raster layers do not show up

I have a list ("datList") with names of raster layers which I want to add. When I add raster layers in the python console everything works fine: for da in datListe: layerDir = "C:/[path]/" + da ...
3
votes
1answer
98 views

ERROR IN processing.run('qgis:countpointsinpolygon',XXX)

When I tried to write a python script to run Count points in polygon (https://docs.qgis.org/2.8/en/docs/user_manual/processing_algs/qgis/vector_analysis_tools/countpointsinpolygon.html) in QGIS, I ...
5
votes
1answer
117 views

In-place modification from Python

I would like to run a geometry processing algorithm from the Python console while using the Edit features in-place modifier. I copied the output from the processing history to see if it works, e.g: ...