Automated GIS Workflows with QGIS & Python

The goal of this module is to introduce the use of Python for QGIS (PyQGIS) to automate typical GIS workflows, such as data visualization, editing, and analysis.

At the end of this module, you will be familiar with the use of Python to write scripts using the PyQGIS API to automate analysis and map production and to extend QGIS with your own interactive Python-based actions, algorithms, and even plugins.

Please note the prerequisites of the module.

At the end of this module, you will be familiar with the use of Python to write scripts using the PyQGIS API to automate analysis and map production and to extend QGIS with your own interactive Python-based actions, algorithms, and even plugins.

Previous Python or programing knowledge is required. If you are not sure whether you qualify, please contact martin.loidl@plus.ac.at.

This is an exclusively english language module, hence any kind of communication with the module lecturer should be in English. A discussion forum is maintained in Moodle in order to support efficient module instruction. You are requested to submit all your questions related to this module to this forum only. The lecturer will check all incoming comments on a regular basis and will answer your questions or provide you with pointers for solving your problems. The module is delivered in form of an instructed self-study. Reading materials and hands-on examples are complemented with multimedia elements. Upon completion of the module students are requested to evaluate the module, which is a part of our quality assurance policy and practice.

  • Software: QGIS
  • Literture: Kurt Menke “Discover QGIS 3.x – Second Edition” (2022).

No special requirements

The module is structured in 7 lessons with 4 assignments. Lecturer assessment reflects student’s achievements in this module and is conducted through assessing module assignments. Assignments must be submitted in written format within the required time period. Lesson exercises are designed to enforce students’ knowledge and skills. These should be completed to allow students to assess their own progress and are not included in the module assessment.

Lesson 1 -Introduction to PyQGIS
This first module lesson provides an introduction to QGIS’ Python API called “PyQGIS”. After this lesson, you will be able to load vector and raster layer using PyQGIS and manage layers in the QGIS project.

Lesson 2 - Creating and Styling Vector Layers with PyQGIS
This lesson covers vector layer creation (including both geometry and attributes), as well as modifying layers (adding features and attributes, calculate attributes), and symbols and styling.

After this lesson, you will be able to create vector data from scratch as well as how to style vector layer with PyQGIS.

Lesson 3 - Automated Spatial Analysis with PyQGIS
This lesson covers spatial analysis from filters and queries to the foundations of automated geoprocessing, e.g., buffer analysis, coordinate transformations. Finally, we explore the concept of custom actions for interacting with data and how to develop actions in Python.

After this lesson, you will be able to filter features and apply spatial analysis functions in PyQGIS. You will also be able to code custom actions for interacting with the data.

Lesson 4 - Automation Using the Processing API
This lesson introduces the Processing API and shows you how to speed up development by exporting Processing models as Python scripts.

After this lesson, you will be able to leverage the Processing API to script workflows.

Lesson 5 - Automated Map Creation with PyQGIS
This lesson introduces different ways to create and export a map: directly from canvas and from print layouts.

After this lesson, you will be able to create maps and map series using PyQGIS.

Lesson 6 -Custom Functions and Geometry Operations
This lesson shows how to develop custom expression functions in Python.

After this lesson, you will be able to code custom functions for use in expressions (for the attribute table, geometry generators, filters, labels, and more)

Lesson 7 - Plugin Development for QGIS
In this final lesson, we take our learnings from the previous PyQGIS lessons to the next level and learn how to create our own plugins. We explore how basic plugins are structured and dive into how to write a plugin that adds algorithms to the Processing toolbox.

After this lesson, you will be able to write a basic QGIS plugin.