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 ParameterFeature Source
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.
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.
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.
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.
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 ParameterFeature
Contact QgsProcessing ParameterFeature, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack