Modern versions of QGIS comes with a handy command-line utility called qgis_process. This allows you to access and run any Processing Tool, Script or Model from the Processing Toolbox on a terminal. This is very useful for automation since it doesn’t require you to open QGIS or manually click buttons. You can run the algorithms in a headless-mode and even schedule them to run them at specific times.
This post covers the following topics
- How to launch qgis_process command on Windows, Mac and Linux.
- How to find the parameters and values for each algorithm and build your command
- Example showing how to do a spatial join on the command-line using the Join Attributes by Location algorithm
- Example showing how to run a model on the command line to automate a complex workflow
Want to follow along? You can download the data package containing all the datasets used in this post. Before running each command, make sure to replace the paths in the commands with the paths on your computer.
Continue reading