Writing Processing algorithms
You can extend the capabilities of QGIS by adding scripts that can be used within the Processing framework. This will allow you to create your own analysis algorithms and then run them efficiently from the toolbox or from any of the productivity tools, such as the batch processing interface or the graphical modeler.
This recipe covers basic ideas about how to create a Processing algorithm.
Getting ready
A basic knowledge of Python is needed to understand this recipe. Also, as it uses the Processing framework, you should be familiar with it before studying this recipe.
How to do it…
We are going to add a new process to filter the polygons of a layer, generating a new layer that just contains the ones with an area larger than a given value. Here's how to do this:
- In the Processing Toolbox menu, go to the Scripts/Tools group and double-click on the Create new script item. You will see the following dialog:
- In the text editor of the dialog, paste the following...