Questions tagged [qgis-processing]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
21 views

Using PyQGIS in standalone scripts outside PyCharm and Spyder

Due to several reasons I sometimes want to use PyQGIS outside of QGIS, without using Python IDEs like PyCharm or Spyder. Am trying to run Python from the OSGeo4W Shell on Windows but am constantly ...
3
votes
2answers
129 views

Invalid syntax in expression using PyQGIS

I am trying to calculate VCI using NDVI values in QGIS Python Console. I am getting invalid syntax for my expression. layer1 = NDVI_layer layer1 = iface.activeLayer() idx = layer1.fields()....
2
votes
2answers
64 views

Run processing algorithm in-place to modify INPUT layer via PyQGIS

I have a line layer with lines potentially having multiple vertices (aside from start and end point) and I need the concerned features to be split at the vertex. The explodelines algorithm does this ...
0
votes
0answers
22 views

Error: Could not load source layer for INPUT using processing

I am trying to run a process script in QGIS 3.16.11. I need to run qgis:distancetonearesthubpoints over selected features from a vector layer created in the script, I use ...
4
votes
1answer
89 views

Adding a point to an existing layer

How can I create a point from two coordinates with the QGIS Modeling tool and add it to an existing layer?
5
votes
1answer
113 views

"AttributeError: 'str' object has no attribute 'crs'" when referring to vector line layer object

I need to test if a vector layer, chosen by the user, is in geographic coordinates, according to the code below: class RoadSlopeCalculatorAlgorithm(QgsProcessingAlgorithm): def initAlgorithm(self, ...
1
vote
0answers
12 views

QGIS v.net not working for certain lines data

I am trying to make a connected network using the v.net GRASS tool. It has worked for 3 vector line layers but is not working for two. I am not sure what the problem is. I used the same settings for ...
6
votes
1answer
104 views

Extremely slow QGIS 3.20.2 startup. Loading of the Processing plugin is too slow (hangs when restoring loaded plugins)

I have QGIS 3.20.2 installed. I just reinstalled everything with OSGeo4W, but the Processing plugin loading is too slow (3 minutes!). How else can I restore the loading speed of QGIS?
1
vote
0answers
35 views

Iteration through all features without performance issues when clipping raster

I wrote a little script but every time I run it I hit a wall with performance. So in order to iterate through each feature for gdal:cliprasterbymasklayer I wrote: from qgis.core import * import qgis....
2
votes
1answer
23 views

Disable image reloading in QGIS 3.16.10 georeference

I am trying to georeference an image (about 50mb and 20000x20000px), and every time I move the image or add a point it reloads/updates the image in georeference window and it takes about 1 minute to ...
0
votes
0answers
18 views

Polygonizing raster files using QGIS gives different area polygons between GDAL 3.3 & GDAL 3.0

I used QGIS with GDAL 3.3 to polygonize a raster file. Added a field using the "field calculator" to calculate the area of individual polygons. Finally, to calculate the sum of the total ...
6
votes
1answer
54 views

Table of content abnormally closing after using showAttributeTable (Processing plugin)

I have recently developed a Processing plugin for QGIS 3.16, which aims to analyze biodiversity data from a specific PostgreSQL database (https://github.com/lpoaura/PluginQGis-LPOData). It is used by ...
2
votes
2answers
60 views

Efficiently join two large point layers by location [closed]

I need to join two point layers containing several million points each. One has an ID and population density, the other has an ID and a settlement model (SMOD) categorization. The attributes of those ...
0
votes
0answers
41 views

How to make this image visible

This is the soil moisture data that I downloaded from the NASA website. When viewing the geotiff file in QGIS I'm getting this black and white picture only. I know that there's some adjustment I need ...
0
votes
1answer
26 views

How to determine the location and boundary of a tile through its file name?

I generated a map tile set using the Generate XYZ tiles (Directory) tool in QGIS. When I then run gdalinfo on one of these images I see no reference to any spatial information: Driver: JPEG/JPEG JFIF ...
1
vote
1answer
56 views

Setting Input to take multiple layers in QGIS Python processing script

I am writing a Python script that I will add in to my processing toolbox. I have got the script working so now just a case of setting my Inputs and Outputs. I am struggling with one, I am trying to ...
1
vote
2answers
65 views

"Difference failed" error when using difference tool with point layers as input and overlay in QGIS

Is it possible in QGIS 3.16 to use the geoprocessing tool "Difference" with point layers as input and overlay? The documentation seems to indicate that it is. However, when I do a test with ...
4
votes
1answer
62 views

Efficient analysis of large amount of CSV files in QGIS

I have hundreds of CSV files with geometry values in the same folder, and I'm trying to import all into QGIS, and use 'count point in grid' function to see how many of each data on each grid. I've ...
2
votes
1answer
65 views

Using custom Processing algorithm from standalone PyQGIS scripts (outside of GUI)

How can I run a custom algorithm using processing.run ? I've extended a QgsProcessingAlgorithm following qgis docs. I've managed to run a native algorithm in a standalone PyQGIS script following Using ...
3
votes
2answers
66 views

After updating to QGIS 3.20.2 vector processing tools are missing

In my QGIS 3.20.2 I can't use tools from the Vector menu as I used in the previous QGIS version. See the print screens. Can somebody tell me why as well as how to resolve this issue?
2
votes
0answers
22 views

Attribute based clustering plugin (in processing toolbox?)- QGIS

In QGIS Python Plugins Repository there is a Plugin called "Attribute based clustering". Because it's a plugin I cannot use it in graphical modeler. The thing is that I want to cluster ...
0
votes
0answers
13 views

Error using matplotlib in QGIS 3 processing script

When I'm using the command plt.show() of Matplotlib in QGIS 3 processing script, it produces this error: File "/usr/lib/python3/dist-packages/matplotlib/pyplot.py", line 269, in show return ...
6
votes
2answers
196 views

Finding the longest horizontal line inside polygon in QGIS

I have a state polygon like the pic shown below, is there a way to find the line which is the maximum horizontal line? Like this, but I want the maximum distance line.
3
votes
0answers
77 views

Looking for QGIS equivalent of ArcGIS "Feature to Polygon" tool

I am looking for a tool (a workflow) in QGIS that does exactly the same as the "Feature To Polygon" in ArcGIS available with Advanced license. I have seen a related question Is there ...
1
vote
0answers
33 views

QGIS: How to extend functionality of "Export to PostgreSQL" algorithm to allow not only overwriting but to TRUNCATE & APPEND [closed]

*** If my question ist not suitable here, were can I post it? *** In the QGIS process modeler, I'm missing a process for uploading a vector layer to a PostgreSQL database by means of TRUNCATE and ...
5
votes
2answers
336 views

"AttributeError: 'str' object has no attribute 'dataProvider'" when persisting layer from memory into project

I'm writing some scripts in QGIS 3 to automate processing using a number of the inbuilt algorithms. I'm using memory layers to store the intermediate results of the algorithms. I'm looking for a ...
2
votes
2answers
66 views

Losing CRS definition saving to GeoPackage with PyQGIS

I'm using PyQGIS to run the processing algorithm "qgis:extractbyextent". The algorithm runs in a for loop using the current extent to perform the clip. Saving the OUTPUT to memory works fine ...
0
votes
0answers
39 views

Merging vector layers and deleting duplicate geometries

I merge 3 extracted layers with different counts of parcels but some attributes contain same data. For example: Having same data input creates duplicate parcel, was able to clean this with delete ...
1
vote
1answer
36 views

Transforming dataframe into feature attribute table in Processing plugin using PyQGIS

I am trying to develop a processing plugin using "Create New Script from Template". In this plugin I have created a pandas dataframe. Assuming the df looks like this: C1 C2 0.25 0.84 0.36 ...
1
vote
0answers
24 views

Running SAGA GDAL libraries from QGIS V3.14.16-Pi on system with admin restrictions [closed]

I am having difficulties running the SAGA raster toolbox io_gdal libraries within QGIS (V3.14.16- PI) on a managed Windows PC (software installed by corporate IT). My IT assistant has asked me if the ...
0
votes
1answer
32 views

How to list multiple fields in "FIELDS" parameter in PyQGIS processing.run ()?

The QGIS "remove duplicates by attribute" tool allows you to remove duplicates across multiple fields. But how can I list multiple fields when I run this tool with pyqgis processing? ...
-1
votes
1answer
40 views

Merging shapefile and raster file and export it as single PNG via PyQGIS [closed]

I have one temperature raster file and one shapefile containing country borders. I want to create a single file by merging the shapefile with the raster file and I export it as a PNG file. I want to ...
0
votes
1answer
44 views

QGIS Line Buffer doesn't work

I want to do positional accuracy analysis by using QGIS 3.16, thus I need to do buffer zone around the vector layer (I am using buffer in geoprocessing tools). However, the result of buffer always ...
3
votes
0answers
21 views

Merging multiple layers in folder with Graphical Model Builder in QGIS 3.10

I am trying to create a graphical modeler that merges all the layers in a folder. I am using QGIS 3.10.12. I saw in some post that there used to be saga:mergeshapeslayer but its not included in the ...
0
votes
0answers
29 views

QGIS Polygonize algorithm, converting raster to vector files different from Mac and Windows

We are trying to convert a single-band raster files with values 0s & 1s to Vector. When using the QGIS's internal algorithm 'Polygonize', the result is slightly off from a Mac then the ones from ...
3
votes
1answer
160 views

Getting the same result from "Generate XYZ Tiles" and "Gdal2Tiles" in QGIS

I am trying to get the same result from these two functions presented in QGIS 3.16. The first one is "Generate XYZ Tiles (Directory)" that it is embedded in QGIS, while the second one is the ...
1
vote
1answer
68 views

Setting QGIS style (QML) file via PyQGIS

I want to set QML style file to raster file and save as image. This code does not set the style file when I run it as standalone script. It works fine in QGIS's Python editor. There is no error in the ...
0
votes
0answers
22 views

SAGA not working in QGIS 3.16 on Mac OS 11.2

In the Toolbox, the SAGA tools are greyed out, for example: I can still double click on the tools and open the dialogue box, although a warning is displayed: I've tried a few tools and they will run,...
2
votes
3answers
76 views

"native:setlayerstyle" algorithm is not running in standalone script

I interpolate and crop the temperature data with PyQGIS (QGIS 3.18). There is no problem so far, but I can not set style file. What can I do set style file correctly? OS: Win10 import os, sys os....
1
vote
0answers
32 views

Can't import orfeo-toolbox algorithms in QGIS Python scripts

So I installed Orfeo-Toolbox on my Windows machine and it's working fine within the QGIS GUI application. But I would like to use OTB algorithms in QGIS Python standalone scripts. So when I load the ...
0
votes
1answer
82 views

Error running QGIS processing algorithm from script

I'm using Python on QGIS to automatize some processes and it's raising an error. here's a sample of my data :mydata Here's my python code: """ 1- boucle d'indentifier les tronçons dans ...
1
vote
0answers
41 views

Speed up processing of field calculator for very large layer

I need to add a new attribute to a layer in order to run a route-finder across a network layer. The layer has thousands of lines that make up a road network. At the moment, I am using the network ...
0
votes
0answers
16 views

QgsFeatureSink doubling line outputs with each script use

I have multiple scripts on qgis3 reading different data sources and creating points and lines layers. The points layers work fine but the lines layers stack lines everytime I launch a script. If I ...
0
votes
0answers
60 views

How to fix ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

I am running the molusce plugin in QGIS 2.18, but when it starts the "Area Change" step, it becomes error. The data that I used in this process are land use map, road map, river map, and ...
3
votes
1answer
68 views

How to connect an algorithm to the input in QGIS graphical modeler?

I may well be missing something very easy, but how do you connect an algorithm in the QGIS graphical modeler to the Input? I'm following an online tutorial and have added the Inputs into the Model; ...
0
votes
0answers
25 views

Creating mbtile from custom processing algorithm

I am creating a custom processing algorithm in which it loads 1, the google satellite 2. get my study_region.shp file 3. loop through the features in study_region.shp 4. and for each feature create ...
3
votes
1answer
119 views

Unable to run qgis_process from command line for native:atlaslayouttopdf QGIS algorithm

I've tried to run below commands in my terminal 1st try qgis_process run native:atlaslayouttopdf --project=/home/thomasg/own-projects/sample-qgis-server/projects/atlas_minimum.qgs --LAYOUT=...
3
votes
1answer
71 views

Filtering OSM natural peaks in QGIS

The primary source of data for a map that I'm making in QGIS 3.14 QGIS 3.20 is OSM. There is a layer which contains natural peaks, obtained with a natural=peak query. In order to reduce clutter, I'd ...
0
votes
1answer
114 views

How I do install a supported version of SAGA to work with QGIS 3.18 on Windows?

I'm running into issues with SAGA processing algorithms in QGIS 3.18. QGIS tells me that SAGA 7.8.2 isn't supported, but doesn't tell me which versions are. I've seen a suggestion that 2.3.x is ...
1
vote
0answers
58 views

Adding text on symbols using PyQGIS

When I go to layer --> properties --> Legend, I can add text on symbols from an expression like round($length , 5). After reading the document here https://qgis.org/pyqgis/3.0/core/Legend/...

1
2 3 4 5
27