Skip to main content
100%

Example of running standalone QGIS 3 processing algorithms in Ubuntu Linux (typical installation)

✓ Published0🌍 Public
Aalpha-beta-soup
Last edited Feb 12, 2019
Created on Feb 12, 2019

This example demonstrates how to run QGIS 3 processing algorithms directly from a standalone Python script on a typical Ubuntu Linux installation, using the `QgsApplication`, `QgsProcessingFeedback`, and `QgsRasterLayer` classes from the `qgis.core` module. It computes raster statistics—specifically a requested stat like `SUM`—via the `processing.run` call with the `"qgis:rasterlayerstatistics"` algorithm. The script initializes QGIS with `app.initQgis()`, registers native algorithms through `QgsNativeAlgorithms`, and prints the selected statistic from a raster file provided as a command-line argument.

AI-generated description

Similar vizzes