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 QgsFeature Request
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.
Finding a common ancestor
from qgis.core import QgsProject, QgsSpatialIndex, QgsFeatureRequest, QgsRenderContext from qgis.PyQt.QtGui import QColor from collections import Counter trafolar_layer = QgsProject.instance().mapLayersByName('transformator_dagitim')[0] # Trafolar katmanı kesiciler_layer = QgsProject.instance().mapLayersByName('kesici')[0] # Kesiciler katmanı ayirici_layer = QgsProject.instance().mapLayersByName('ayirici')[0] # Ayırıcılar katmanı kesici_index = QgsSpatialIndex(kesiciler_layer.getFeatures())...
Adding attribute values to existing GeoPackage with PyQGIS
I have an existing GeoPackage and want to copy Features from another layer to this one using PyQGIS and execute it inside a QGIS Macro.
Applying if-condition for NULL values in QGIS Python Console
Your condition if current_value is None: fails because it is not working with NULL-values which moreover are of the PyQt5.QtCore.QVariant (qgis.PyQt.QtCore.QVariant) class type. There are several solutions to solve your issue available: As, was already noticed by @couteau, the best way to treat NULL-values via Python's not-equal i.e. != comparing operator. Additionally one needs to import these NULLs i.e. from qgis.core import NULL: from qgis.core import NULL if current_value == NULL: ...
QGIS Python console - if condition for NULL values
I'm new to Python. I have already made some programs with geopanda. It works very well but now I'd like to use the Qgis python console this time to do some simple operations that I can't do with Qgis expressions. I'll give you the context because this may not be the best way. I want to create excel synoptics from shapefiles or Postgres databases. To know where the start and end points are, I think I need to create logical identifiers for all my entities instead of a simple unique identifier.
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.
How do I speed up selection of a large number of features
I'm looking for ways to speed up selection of a large number of features (10k+) from a list of attribute values. I'm developing a plugin to trace a pipe network, and select the tranversed pipes. The pipe 'graph' is stored as a LineString layer with PIPE_ID, START_NODE and END_NODE attributes. I have solved the problem of finding PIPE_IDs for the tranversed pipes using a cached graph. The bottleneck appears to be finding the feature IDs of features to select.
Runnig the PyQGIS script without opening the project in the GUI
Asked today Viewed 7 times I have a successful Python code that runs in the QGIS Python Console when a project is open to calculate the shortest path between hundreds of points. I now want to run the code across lots of projects without actually opening them in the GUI, but still using the QGIS Python Console. My code runs but it fails to calculate the shortest path. Do I need to amend or change the code to ensure it runs without opening the project in the GUI? Below are some key parts of the code.
For QGIS processing algorithm python scripts, how to limit selectable layers in algorithm input when using @alg decorators
Asked today Viewed 3 times When using the @alg decorator to scaffold a processing algorithm, we use the @alg.input to declare new widgets for the interface. We can declare these as alg.SOURCE for layers we use in the algorithm. Unlike the standard approach, there does not appear to be a place where we can identify allowable geometry types (Point/Line/Polygon) for the layer.
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 QgsFeature
Contact QgsFeature, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack