Questions tagged [qgis-processing]
Spatial data processing framework that brings advanced analysis capabilities to QGIS.
1,458
questions
0
votes
0
answers
26
views
Joining line data to points using QGIS
Assets:
Green point layer
Blue point layer (with alphabetical FID attribute)
Red line layer (with numerical FID Attribute)
Blue line layer
Goal:
Join red line FID attribute to Blue point in order away ...
0
votes
0
answers
17
views
How to define a hidden string as an imput in QGIS scripts
I have an R Script in QGIS as a processing tool and it logs into a location with a username and password using the ##username=string ##password=string it works fine but the password shows mypassword21!...
0
votes
1
answer
17
views
'QGIS Processing Executor'_Issue: "sqlite3_open ... unable to open database file"
Trying to run a self built-in QGIS-model (*.model3) using the followoing 'QGIS Processing Executor' (qgis_process) command in the command line does not work.
C:\Program Files\QGIS 3.24.1\apps\Qt5\bin&...
1
vote
1
answer
21
views
How can I activate GeoTIFF compression in QGIS 3.x gdal_translate?
I am a beginner at Python so please excuse this stupid question. I am working on a simple QGIS plug-in for saving GeoTIFFs and I want to give the user the option to switch on compression when saving ...
1
vote
0
answers
22
views
QGIS: 'Incorrect parameter value for AGGREGATES' when using Aggregate in a Python-Processing-Script
I am currently working on a QGIS-Python-Processing-Script that creates an automated street register for a printed city map as a CSV file.
In that context I want to give the user the option to choose ...
2
votes
1
answer
30
views
"One or more line ignored due to geometry not having a minimum of three vertices" error when "Line to Polygon" in QGIS
Converting "Line to Polygons" using geometry tools in Vector could not be executed results shows this picture
How to solve this issues?
2
votes
2
answers
72
views
Clip features of lines based on parameter from another shapefile (Polygon)
I want to clip each line feature that is falling inside the polygons and want to save the line files with the name of ID which is in the polygon layer.
Output:
2
votes
0
answers
31
views
How do the two sets of parameters in the Coordinate Operation processing tool interact?
QGIS' modeler provides a "Coordinate Operation" processing tool as model input. One can use it to specify the exact coordinate operation a transformation/reprojection will use.
The ...
1
vote
0
answers
22
views
Using PyQGIS to replicate my PostGIS result of placing radial lines over polygons
As shown in this photo I have some polygons.
I want to make a grid over these polygons (lets say the squares of the grid are 100x100) and over each square I want to place radial lines going through ...
1
vote
1
answer
21
views
Point to path not in linear connection
I'd like to know how to connect two points not in a linear way (shortest way), but following an existing route in QGIS. I'm using "Points to path".
For example, not in this way:
but in this ...
1
vote
1
answer
59
views
Using PyQGIS to buffer the width different than the height of a rectangle
So I have a polygon in QGIS (3.18) and it will always be a rectangle (I create it using minimum bounding geometry, oriented rectangle) I want to buffer the width out using some math to get the total ...
0
votes
0
answers
43
views
Strahler stream order is not generated in any of the algorithm SAGA, PCRaster or GRASS in QGIS
When generating strahler order by SAGA in QGIS it indicate that
QGIS version: 3.22.6-Białowieża
QGIS code revision: b6f33b1a
Qt version: 5.15.2
Python version: 3.9.5
GDAL version: 3.4.2
GEOS version: ...
0
votes
1
answer
26
views
Tool generating hill slope forms (divergent, convergent, uniform) in QGIS
Does anyone know a tool or procedure for generating a raster file of slope forms (divergent = upper slope wider than lower slope, convergent = upper slope narrower than lower slope and uniform = upper ...
0
votes
1
answer
21
views
Issue when running refactorfields from the python console
I've an issue when trying to run the processing tool refactor fields from the python console. I'm trying to write a script that acts as a macro and refactors layers with well known fields into another ...
1
vote
0
answers
26
views
joinbylocationsummary with loop on the same input layer using PyQGIS
I have adapted a script to use "qgis:joinbylocationsummary" in a loop.
I would like to adapt it so the loop adds all the .shp of the directory 'layers_I_want_to_add' to join their maximum to ...
2
votes
0
answers
18
views
Any advice on how to use r.stats in QGIS
I am trying to run r.stats in QGIS to get all unique combinations of data values from 2 raster layers. The process runs, outputs an HTML file, and does not throw any errors. However the files are ...
0
votes
0
answers
16
views
QgsConditionalStyle based on my custom Python function in my plugin
I'm writing a plugin that validates data, and indicates invalid values by making the background red for that particular value in the Attritube Table.
Currently I am doing the following. My plugin ...
0
votes
1
answer
55
views
OGR error "is not a directory" when moving to Windows from UNIX
I have to write a script that works either on Windows or macOS.
I want to run these lines :
processing.run('native:refactorfields',{ 'FIELDS_MAPPING' : [{'expression': '"Name"','length': 10,'...
3
votes
0
answers
69
views
Selecting and changing fields in QGIS graphical modeler
I am trying to run a model that makes a selection from a refactored and name changed field, and changes the value of the selection.
Refactoring is easy, as is making the selection within the renamed ...
1
vote
0
answers
30
views
Different number of records in gpkg vs. shapefile after join
I'm using pyqgis 3.10.1.and trying do Spatial join with one-to-many option for points and multipolygon. After processing result shows me too low number of records. I save results to geopackage but ...
1
vote
1
answer
34
views
PyQGIS standalone app processing with selectbylocation not working
I'm trying to run processing with selectbylocation in standalone app, everything seems to run fine but the output I'm getting is the main layer always, so it's not really working. And I have no idea ...
0
votes
0
answers
43
views
Improving PyQGIS processing time when using "Select by location"
When running PyQGIS processing with "qgis:selectbylocation" it takes a lot of time (sometimes it get to an hour).
Is there is a way to make it work faster?
parameters = {
"INPUT&...
2
votes
1
answer
59
views
Snap Geometries to Layer unexpected behavior
I have been trying to snap points to a line layer (vertex or segment)
but the "Snap Geometries to Layer" processing algorithm with behavior 3 supposed to do what I want
Prefer closest point,...
2
votes
2
answers
46
views
Creating land area polygon from shoreline within chart border in QGIS
I'm trying to create land area polygon from a shoreline within a chart border in QGIS, and there are some lakes that needs to be clipped from the land area. I've tried the "Lines to Polygon",...
1
vote
1
answer
38
views
Solve "ERROR: Too many connections: max 64 while"
I would like to apply zonalstatisticsfb to 30 raster file on 3 different areas each time. I guess Python have to loop 90 times.
This is the code I am using :
def extract_stats(a,b,c):
import ...
0
votes
0
answers
22
views
Importing an output layer variable from one file/script to another
In the first script a layer is created, then the user can manually mark areas. In the second script the marked areas should be saved.
I wonder if I can import the created layer from the first script ...
0
votes
0
answers
13
views
Automatically activate the general tools from qgis project in script
I have a script and would like to put it in edit mode at the end so the user can start immediately. I would also like to automatically select the tool "Select Features by area or single click&...
1
vote
1
answer
35
views
Connect polygons with gap without dissolve intersected polygons in QGis
I want to close gaps between polygons that are not intersecting and without a barrier in between (like streets).
Is it possible to aggregate or connect neighboring polygons (or closing the gaps ...
4
votes
1
answer
58
views
Setting selected features in list without specifying their layer using PyQGIS
To get selected features I usually do: layer.selectedFeatures().
Is there a method to retrieve selected features in a list without specifying the layer they belong to ?
I selected features with the &...
1
vote
0
answers
32
views
Dividing a polygon into only two equal areas in QGIS
I would like to look at only 50% of the area. To do this, I would like to divide the surface into two equal areas. (Afterwards, I would like to automate it using the model builder).
I have followed ...
0
votes
0
answers
12
views
Extracting singular attribute from WFS layer to new table using QGIS
Is there any way of extracting a singular attribute from a WFS layer into a separate table?
I currently have about 10-15 WFS layers and am using the 'Extract by Location' algorithm, and then merging ...
2
votes
1
answer
35
views
QGIS Processing Plugin: automatically set "edit rendering styles for outputs"
I have created a Processing plug-in with the help of plugin builder.
To finalize the outputs, I have created .qml files to be loaded in the "Edit Rendering Styles for Outputs..." dialog.
...
0
votes
0
answers
20
views
QGIS - Many raster - change resolution, coordinate system and export
I have ca. 50 rasters and I want to batch export them after changing the resolution and coordinate system. Any suggestions?
0
votes
0
answers
28
views
input not detected using qgis_process when it works fine using the GUI version
As per the title.
I have made sure that the input does in fact exist, and that it is not in use by some other program that might be blocking reading (such as QGIS itself) that hasn't worked for me so ...
1
vote
0
answers
24
views
Is it possible to run grass v.generalize as part of a separate console (ie not inside QGIS)
As per the documentation :
There is not a processing console in QGIS, but all processing commands
are available instead from the QGIS built-in Python console. That
means that you can incorporate ...
0
votes
0
answers
21
views
Standalone PyQGIS script set layer in AddFeature mode for user
I have written a script in the Python console and would like to bring in a standalone script. In the end I put the layer with i.face in edit mode and AddFeature, because the user should only set ...
2
votes
1
answer
68
views
How to run QGIS 3 processing tool (DISSOLVE) in c++
For my QGIS C++ Plugin I have to run the QgsDissolveAlgorithm- processing tool.
I have found an example, how to do that in python:
import processing
infn = "path/to/dissolve"
outfn2 = &...
1
vote
1
answer
24
views
GDAL Clip raster by mask layer can't see files on external drive
So I am using GDAL Clip raster by mask area. I tried clipping a temporary raster to mask area and started getting errors that an error had occurred creating the output file. It seems that the issue ...
1
vote
0
answers
31
views
QgsProcessingToolboxTreeView has been deleted
I try to add the Google Satellite layer by adding it through Layers > Add Layer > XYZ Layer and using the URL http://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z} as the source. I then ...
1
vote
0
answers
29
views
How to set a layer automatically in edit mode and addFeature mode
I have load a new layer in my QGIS project by a processing script. At the end I would like to set the layer in edit mode and addFeature mode. Thus the user only has to set the points afterwards.
from ...
1
vote
0
answers
37
views
Address open Layer in QGIS project by processing script, convert Python console into a processing script
I created this code in the Python console, a new point layer is created with some attributes and set into edit and AddFeature mode. I would like to bring it in QGIS algorithms. I have tried a few ...
0
votes
0
answers
24
views
QGIS Plug-In doesn't work with exported Python script from Modeler
I am currently creating a QGIS 3.16/3.22 Plug-In. For this, I have created a model in QGIS Modeler and exported the Python script.
I have changed it according to this Converting Model in Plug-in in ...
2
votes
1
answer
40
views
Setting labels and color to a new layer in a QGIS processing script
I have created a new layer by an algorithm (intersection; buffer and so on) in a processing script. I would like to add a label to the new layer through a field (id number) of the attributes table. ...
1
vote
1
answer
52
views
QGIS processing algorithm, nested algorithm run returns string
I am building a custom processing script using the QgsProcessingAlgorithm class.
In the early part of my algorithm, I am processing an input feature using the native 'centroids' algorithm. I want to ...
0
votes
1
answer
29
views
Why is script calculating Ellipsoidal area instead of cartesian area?
I have this two shapefiles (https://drive.google.com/file/d/1a83sh-V46uaoUFwPXEtoZnD_XUBGG9X9/view?usp=sharing). The original one is in 4326 reference system.
The second one is the result of qgis ...
1
vote
1
answer
65
views
Reclassification of raster by classification method in QGIS
I am trying to reclass my raster data based on the reclassification methods ( equal interval, quantile,..) in QGIS like we do in ArcMap. I don't see any tool in QGIS to perform reclassification of ...
2
votes
1
answer
101
views
PyQGIS QgsExpression which categorizes the values of a field in a new field
I have a code that works well in the GUI for the field calculator but I am trying to make it work in the python console of QGIS.
Firstly I start off with a roads then calculate the azimuth of the road ...
7
votes
2
answers
110
views
Creating set number of regularly spaced points inside of polygon in QGIS
My application for this would be for making maps with pre-established plot points for cruising a stand of timber, but I could see this being used for other applications.
I am a little surprised that ...
2
votes
0
answers
64
views
Extracting mountain peaks from a DEM in QGIS
I want to find and extract the location and height of the highest 500 mountain peaks in a given area.
I was thinking to use NASADEM dataset and QGIS, but I did not find any working tools.
I am an ...
2
votes
1
answer
65
views
QGIS custom process script crashing when output is set to [save as temporary file]
I'm trying to convert a pretty simple pyqgis script to a proccessing script for use in a model I'm creating. The script works as intended when setting the output in the process UI to a file on my ...