“In this lesson will look at the QGIS Processing Toolbox which provides a collection of spatial analysis tools.”
The processing framework in QGIS provides a general analysis toolbox. The tools provided include native QGIS analysis routines and 'wrappers' for analytical functions provided by third-party software such as GRASS, SAGA and Orpheo Toolbox. More providers can be used via a plugin architecture.
Each tool (in QGIS terminology these are called algorithms) in the toolbox is intended to carry out a specific task. When you use a tool it will define the required inputs - for example, one or more raster or vector layers, and generally, create a new output dataset containing the result of the analysis. These tools can also be 'chained' together in a workflow which we will cover in a separate lesson. In this lesson, we will try out the basic usage of the processing toolbox to understand the concept.
Goal: To practice and understand the process of using processing algorithms
We are going to extract vertices from a polygon layer, create a randomised subset of those vertices and then generate a minimum convex hull of the subset.
polygon.geojson
to an empty QGIS projectRemember that where you see 'algorithm' you will need to locate the relevant tool (algorithm in QGIS terminology) either by using the toolbox search function or by browsing around in the toolbox algorithm list.
Name | Expectation |
---|---|
Algorithm |
Extract vertices |
Input layer |
polygon |
Output layer |
[Create temporary layer] |
Algorithm |
Random extract |
Method |
Number of features |
Number / percentage of selected features |
10 |
Algorithm |
Minimum convex hull |
Here are a few key things to remember when using processing algorithms:
Help system: Almost all of the processing algorithms have useful help in the help panel to the right of the algorithm dialogue. Be sure to review this help when trying to understand what the algorithm does.
Logs: Sometimes an algorithm may not run correctly. This may be because of a bug in the algorithm itself, or a problem with your input data. If you have a problem, reviewing the logs can provide helpful information for you to correct the issue or report a bug if needed.
Per-feature repeats: Sometimes it is useful to treat each input feature as a separate analysis task. Pressing the green 'iterate over this layer' button will do this. For example, if you run the fixed distance buffer algorithm on your random points subset with the 'iterate over this layer' option enabled, you will see that a new layer is generated for each of the original input features.
Output destinations: QGIS will automatically create a new temporary layer for the output produced by an algorithm. You can optionally specify your own output layer path for the analysis results if you wish.
Advanced users may want to look at the numerous options for processing in the processing menu (QGIS 2.x) or in the settings menu (QGIS 3.x). In some cases using processing algorithms may require that you install third-party software. For example, the Orfheo Toolbox algorithms will only work if you have actually installed Orfeo Toolbox separately.
What does the processing toolbox in QGIS do?:
Is it possible to connect multiple processing algorithms in a processing chain?:
Download the sample data for the lesson.