Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Articles by QgsProcessing Algorithm
attributes table does not reflects changes with script opened from file or added to the toolbox
I'm using QGIS 3.44.9. I'm trying to build a script that adds a layer to my project at the end. But I'm troubled with script behavior depending on wether it's executed with the open existing script or with the add script to toolbox option.
Manipulating Print layouts within the postProcessAlgorithm() using PyQGIS
Quite a few native QGIS algorithms implement thread sensitive tasks in the prepareAlgorithm() method which should be called from the main thread. E.g. https://github.com/qgis/QGIS/blob/cd2944e57f98b434d7ab0643ecf7f909752cf970/src/analysis/processing/qgsalgorithmapplylayerstyle.cpp#L69 Note that this method returns a boolean, while processAlgorithm() returns a dictionary.
Empty @layer_name variable in QGIS expression using the "Geometry by expression" tool
This is a bug (#54869) with no workaround other than hardcoding the layer. An alternative to using the native (C++) Geometry By Expression tool is to modify the old python Geometry By Expression tool from QGIS 3.10 and add the missing layer scope to the expression context using QgsExpressionContextUtils.layerScope.
How do I run GRASS8 in VS Code as part of PyQGIS standalone script?
I'm trying to run GRASS8 in a standalone PyQGIS script. I've imported the QGIS processing, do I need a separate import for GRASS8?
PyQgis: Processing algorithm load output raster
I am writing a standalone processing algorithm with pyqgis. The intention of the script is to create an offline basemap that is created only within the extents of objects of one layer. Therefore I am using the native:rasterize tool in a for loop to create the list rasters of temporary rasters. This list is eventually used in gdal:merge to be merged together to one raster. The script runs smoothly until the final step of loading the final raster back to the QGIS project or save it.
QGIS - real struggle with providing correct input parameters (self.addParameter(types) not working)
I want to create a script which will work inside QGIS (from toolbox). It should take as input multiple rasters and a vector layer (always 1 polygon). Check if raster overlaps with vector - if yes, add to list. Pass the list to virtual raster, then pass the virtual raster to rvt tools. The output is a folder containing the resulting rvt rasters. I got completely stuck at trying to pass the correct input parameters.
Issue with custom QGIS process algorithm
I have a written a custom processing algorithm which iterates features within one vector layer and eliminates polygons of the second that are within each feature from the first under a specific size.
PyQGIS Processing Script Template - Bugs im Code
Based on the QGIS Processing API template I am trying to write a test script that calculates geodesic distances between point geometries using qgis:distancematrix. User selects the from- and to-point layer with the corresponding ID attribute fields, the matrix type and the output location via GUI analogous to the mentioned QGIS processing tool.
"Could not load source layer for INPUT: memory: not found" error in Processing Script using PyQGIS
The error occurs because the intermediate results stored in memory are not being handled properly. QGIS sometimes has trouble managing layers in memory between processing steps.
QGIS Script - Fundamental questions about creating layers
I'm searching all around how to create a new layer on a QGIS Script (that you can add to the tool bar). I see many things that don't work, or work partially, and I can't figure out what types and values are expected. So, regarding the following code where I try to create a new layer from scratch, how can I make it add the layer to the map?
QGIS Script - How to add results to map?
I followed the instructions in https://docs.qgis.org/3.34/en/docs/user_manual/processing/scripts.html to create my own script (the code below is a test code, not the full code, please don't focus on "what" it's doing) The script runs without errors, the log says its outputting correctly, but the output never goes to the map. How can I make the results appear in the map? Is there anything missing in my code?
Issue with displaying loaded layer in QGIS
After building a plugin using Plugin Builder I've encountered an issue where selections made in a result-loaded layer are not visible in canvas. I have to zoom in or out to refresh this layer.
QgsProcessingAlgorithm.initAlgorithm() is abstract and must be overridden
If i create a processing script from the template provided, i get this error (that is spammed every time i open qgis) I couldn't figure out a way to get rid of it (despite the error, the scripts I've generated starting from this template works) Any idea?
Message Bar called from a script shows in its own little window?
I'm trying to show a message bar in the main window, reporting on the result of a processing script. However, an empty message bar appears in the main window, and the text appears in a small little separate window, as below: With a different message level (Warning) the blank message bar and the new window change their colour and icon accordingly: But I prefer a normal message bar, all in one piece/place. Anyone know what is missing here?
Correct way to specify Inputs and Outputs for QGIS processing scripts that use custom widgets?
Processing scripts do not allow parameter inputs to be changed by other parameter inputs. This can be overcome by defining a custom widget which does have the desired interactions, then using a 'widget_wrapper' to add the custom widget to the processing parameter inputs.
How to allow layer created by externally developed python script to be available as input to algorithms in QGIS model builder?
I downloaded a python script from here, using the final code posted in the comments with a fix to solve an integer/python2-3 compatibility issue: https://spatialthoughts.com/2021/01/31/equal-sized-kmeans-qgis/ import networkx as nx import numpy as np from itertools import groupby from PyQt5.QtCore import QCoreApplication, QVariant from qgis.core import (QgsProcessing, QgsProcessingAlgorithm, QgsProcessingParameterFeatureSource, QgsProcessingParameterNumber,...
PyQGIS Masterclass - Customizing QGIS with Python (Full Course Material)
4.1 Calculating distance using PyQGIS A basic but important operation in a GIS is the calculation of distance and areas. We will see how you can use PyQGIS APIs to compute distances. We will compute distance between the following 2 coordinates san_francisco = (37.7749, -122.4194) new_york = (40.661, -73.944) QGIS provides the class QgsDistanceArea that has methods to compute distances and areas. To use this class, we must create an object by instantiating it.
QGIS crashes when generating MBTiles with PyQGIS script
Asked today Viewed 3 times I am trying to write a script to generate MBTiles. The script works when the 'ZOOM_MIN' and the 'ZOOM_MAX' are the same. As soon as I change the 'ZOOM_MAX', QGIS crashes with the error : Windows fatal exception: access violation Thread 0x00001d28 (most recent call first): Even though QGIS crashed, the MBTiles file is generated correctly in the right folder. How to explain this ?
Show More
loading
Actions
Is this you?
As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.Get in touch with QgsProcessing
Contact QgsProcessing, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack