QGIS processing models, are they any good for calculating basic land use statistics, such as percentage of forest or water? It had to be tried. There are a lot of data sources to use and I picked the product Topography 250 Download, vector, from Lantmäteriet, the Swedish land survey. The data set is available as open data, but you do need to create a free account to access it. Being a generalized data set, it is great for testing a work flow, but for your final analysis, a more detailed data set, such as Topography 10 Download, vector, might be more suitable. The data set covers all of Sweden, but for this test, I used a subset, the Orust municipality.
The data had previously been written to my PostGIS database and nowadays, it is possible for a QGIS model to read data not already present in your project. This option is a bit hidden when you run the model, but it is there:
Pick PostgreSQL… in the window that pops up and select your database connection (configured in advance).
The model does these operations:
- Filter and clean the data
- Dissolve features
- Calculate difference
- Calculate statistics: percentage of forest for the Orust municipality.
The final model looks like this:
And the result of this simple analysis? 40.1% forest cover for all of the municipality:
I have previously covered a few improvement suggestions for QGIS models and while working with this analysis, a few more came up:
- Moving an algorithm in the model should also move its attached comment
- Allow setting font style for comments
- All algorithm windows use the same screen size, which means a lot of resizing of windows while working with a model
- It should be possible to deactivate visual output from an algorithm
- It doesn´t seem possible to use more than one input for an algorithm. What if I want to use the output from several algorithms as input?
- Algorithms, such as the Field calculator, are unaware of incoming attributes, this has to be configured manually
The model is available for download on GitHub.