A practical introductory course on automating GIS workflows with Python and PyQGIS. Participants learn how to control QGIS through the Python Console and integrated editor, process geospatial data programmatically, and combine existing QGIS tools into automated workflows.
You will become familiar with the fundamental interfaces and objects of the QGIS Python API and use the iface object to access maps, layers, the map canvas, and other parts of the application. You will load and manage vector layers, read and modify attributes, and carry out geometric calculations.
You will also call existing QGIS and Processing tools from Python, automate multistage workflows, and develop your first custom Processing scripts. Fundamental approaches to error handling, documentation, and clean code will help you create reliable and maintainable scripts.
By the end of the course, you will be able to develop simple to moderately complex PyQGIS scripts and automate recurring tasks in QGIS efficiently.
• Use the QGIS Python Console and integrated editor confidently
• Access essential QGIS functions through the iface object
• Load, find, organise, and remove layers programmatically
• Read, calculate, and modify vector attributes
• Select features and adjust their symbology
• Calculate areas, distances, and centroids with Python
• Call existing QGIS and Processing tools from scripts
• Combine several processing steps into automated workflows
• Use temporary layers and batch processes
• Develop custom Processing scripts
• Identify, handle, and investigate errors
• Produce readable, documented, and maintainable Python code
• Fundamental knowledge of QGIS
• Basic knowledge of Python
• Experience with layers, attribute tables, and simple geoprocessing tools
• A basic understanding of vector and geometry data
*We customize the course outline and content to your specific needs and relevant use cases.
Module 1: Introduction to QGIS Programming
• Applications of Python within QGIS
• PyQGIS as the programming interface to QGIS
• Differences between manual, model-based, and scripted workflows
• Typical automation tasks in GIS projects
• Structure of a simple QGIS Python script
• Dividing recurring processes into individual programming steps
• Capabilities and limitations of automation
Module 2: Development Environment and Python Console
• Opening and using the QGIS Python Console
• Running individual commands interactively
• Using command history and automatic completion
• Introduction to the integrated script editor
• Creating, saving, and rerunning script files
• Developing and testing code incrementally
• Reviewing outputs and messages in the console
• Organising scripts and exercise data clearly
Module 3: Reviewing Python Fundamentals for PyQGIS
• Using variables and essential data types
• Processing strings, numbers, and Boolean values
• Working with lists, tuples, and dictionaries
• Creating conditions with if, elif, and else
• Implementing repetition with for and while loops
• Defining and calling functions
• Importing modules and classes
• Applying indentation and basic Python syntax correctly
Module 4: The iface Object as the Interface to QGIS
• Purpose and operation of the iface object
• Accessing the current QGIS project
• Identifying active layers and selected features
• Accessing the map canvas and current extent
• Working with the layer tree and legend
• Refreshing the map and zooming to layers
• Displaying messages and guidance within the QGIS interface
• Supporting user actions through scripts
Module 5: Managing QGIS Projects and Layers
• Accessing the current project through PyQGIS
• Reading layers from a project
• Finding layers by name or ID
• Distinguishing vector and raster layers
• Adding and removing layers
• Controlling layer visibility and order
• Organising layers into groups
• Examining project properties and data sources
Module 6: Loading and Inspecting Vector Layers
• Loading shapefiles and GeoJSON files
• Connecting geodatabase and other vector data sources
• Creating memory-based layers
• Checking whether a layer is valid
• Reading geometry type and coordinate system
• Examining fields and attribute structures
• Determining feature count and spatial extent
• Querying data-source and provider properties
Module 7: Reading Features and Attributes
• Iterating through the features of a vector layer
• Reading feature IDs and attribute values
• Accessing individual fields directly
• Handling null values and different data types
• Filtering features with conditions
• Producing structured attribute output
• Transferring information into lists or dictionaries
• Preparing results for further calculations
Module 8: Creating and Modifying Attributes
• Controlling a layer’s editing mode
• Adding new attribute fields
• Changing field values for individual features
• Updating multiple attribute values automatically
• Performing calculations comparable to the Field Calculator
• Implementing default values and conditional calculations
• Saving or rolling back changes
• Creating safe and traceable editing workflows
Module 9: Selecting and Filtering Features
• Selecting features by ID
• Using attribute-based expressions
• Combining spatial and operational selection conditions
• Reading and modifying existing selections
• Clearing or extending a selection
• Using selected features in subsequent processing steps
• Highlighting results in the map canvas
• Automating selection processes
Module 10: Processing Geometries with PyQGIS
• Reading geometry objects from features
• Distinguishing point, line, and polygon geometry
• Examining coordinates and vertices
• Calculating lengths and areas
• Determining polygon centroids
• Measuring distances between features
• Using bounding boxes and spatial extents
• Writing geometric results to attribute fields
Module 11: Creating Features and Geometries
• Creating simple point geometries with Python
• Building lines from coordinate lists
• Creating polygon geometries
• Assigning geometries and attributes to new features
• Adding features to existing layers
• Creating temporary result layers
• Considering coordinate systems when generating geometry
• Saving and reviewing results
Module 12: Controlling Symbology with Python
• Examining layer renderers and symbols
• Changing symbol colour, size, and outline
• Creating simple symbology programmatically
• Configuring categorised representations
• Preparing graduated symbology
• Controlling displays through attribute values
• Refreshing layer rendering after changes
• Automating symbology workflows for several layers
Module 13: Calling QGIS Tools from Python
• Using existing QGIS functionality programmatically
• Examining available Processing providers and algorithms
• Identifying algorithm IDs and required parameters
• Defining input and output parameters
• Calling tools through Python
• Reviewing results and return values
• Checking error messages and processing information
• Converting manual tool operations into scripts
Module 14: Working with the Processing Module
• Structure and operation of the Processing Framework
• Using tools such as Clip, Buffer, Dissolve, and Export
• Converting data formats
• Processing layers according to attribute or spatial conditions
• Combining multiple tools into a workflow
• Using one tool’s output as the input for a subsequent step
• Introduction to Processing contexts and feedback objects
• Adding results to the project automatically
Module 15: Temporary Layers and Intermediate Results
• Distinguishing temporary and permanent outputs
• Generating processing results in memory
• Using intermediate outputs in subsequent tools
• Examining temporary layers programmatically
• Saving results permanently when required
• Considering the storage requirements and lifetime of temporary data
• Avoiding unnecessary intermediate datasets
• Keeping scripted workflows clear and efficient
Module 16: Workflow Automation
• Analysing a manual GIS workflow
• Defining input data, processing steps, and outputs
• Running multiple Processing tools sequentially
• Generating file names and paths dynamically
• Checking intermediate results
• Controlling alternative workflows with conditions
• Producing progress messages and results
• Making automated processes reproducible
Module 17: Batch Processing with Python
• Automating recurring tasks across several files or layers
• Searching directories and data collections
• Selecting suitable inputs by file name or type
• Using loops for repeated tool calls
• Naming and saving outputs automatically
• Skipping invalid or unsuitable datasets
• Recording progress and processing results
• Testing and optimising batch processes
Module 18: Developing Custom Processing Scripts
• Structure of a Processing script algorithm
• Defining input and output parameters
• Using vector layers, fields, numbers, and file paths as parameters
• Implementing programme logic in the processing method
• Reporting progress and status information
• Returning results to the Processing Framework
• Providing scripts through the Processing Toolbox
• Documenting and reusing custom tools
Module 19: Error Analysis and Debugging
• Distinguishing syntax, runtime, and data errors
• Reading Python and QGIS error messages
• Producing controlled output for variables and intermediate results
• Isolating errors through incremental testing
• Protecting critical code with try and except
• Creating informative custom error messages
• Identifying invalid layers, fields, and file paths
• Testing scripts with different input datasets
Module 20: Best Practices for PyQGIS Scripts
• Using meaningful variable and function names
• Dividing code into clear sections and functions
• Applying comments appropriately and clearly
• Creating docstrings for functions and scripts
• Following common Python code conventions
• Avoiding repeated code
• Validating inputs before processing
• Documenting dependencies and assumptions
• Designing scripts for future maintenance and adaptation
Module 21: Practical Project – An Automated QGIS Workflow
• Selecting and structuring a typical GIS workflow
• Loading and checking input data programmatically
• Reading or modifying features and attributes
• Conducting geometric calculations
• Combining multiple Processing tools
• Managing temporary and permanent results
• Adding error handling and status messages
• Providing the workflow as a custom Processing script
• Testing, documenting, and reviewing the results
Modul 12: Symbolisierung mit Python steuern
• Renderer und Symbole eines Layers untersuchen
• Farbe, Grösse und Kontur von Symbolen verändern
• Einfache Symbolisierung programmgesteuert erstellen
• Kategorisierte Darstellungen konfigurieren
• Abgestufte Symbolisierung vorbereiten
• Darstellungen anhand von Attributwerten steuern
• Layer-Darstellung nach Änderungen aktualisieren
• Symbolisierungsabläufe für mehrere Layer automatisieren
Modul 13: QGIS-Werkzeuge aus Python aufrufen
• Bestehende QGIS-Funktionen programmgesteuert verwenden
• Verfügbare Processing-Anbieter und Algorithmen untersuchen
• Algorithmus-IDs und erforderliche Parameter ermitteln
• Eingabe- und Ausgabeparameter definieren
• Werkzeuge über Python aufrufen
• Resultate und Rückgabewerte auswerten
• Fehlermeldungen und Verarbeitungshinweise kontrollieren
• Manuelle Werkzeugabläufe in Skripte übertragen
Modul 14: Arbeiten mit dem Processing-Modul
• Aufbau und Funktionsweise des Processing-Frameworks
• Werkzeuge wie Clip, Buffer, Dissolve und Export verwenden
• Datenformate konvertieren
• Layer nach Attributen oder räumlichen Bedingungen verarbeiten
• Mehrere Werkzeuge zu einem Ablauf verbinden
• Ausgaben eines Werkzeugs als Eingaben weiterer Schritte verwenden
• Processing-Kontexte und Feedback-Objekte kennenlernen
• Ergebnisse automatisch zum Projekt hinzufügen
Modul 15: Temporäre Layer und Zwischenergebnisse
• Temporäre und permanente Ausgaben unterscheiden
• Verarbeitungsergebnisse im Arbeitsspeicher erzeugen
• Zwischenergebnisse für nachfolgende Werkzeuge verwenden
• Temporäre Layer programmgesteuert untersuchen
• Ergebnisse bei Bedarf dauerhaft speichern
• Speicherbedarf und Lebensdauer temporärer Daten berücksichtigen
• Unnötige Zwischendaten vermeiden
• Skriptgesteuerte Arbeitsabläufe übersichtlich halten
Modul 16: Workflow-Automatisierung
• Einen manuellen GIS-Arbeitsablauf analysieren
• Eingabedaten, Verarbeitungsschritte und Ausgaben definieren
• Mehrere Processing-Werkzeuge sequenziell ausführen
• Dateinamen und Pfade dynamisch erzeugen
• Zwischenergebnisse kontrollieren
• Unterschiedliche Abläufe anhand von Bedingungen steuern
• Fortschrittsmeldungen und Ergebnisse ausgeben
• Automatisierte Prozesse reproduzierbar gestalten
Modul 17: Batch Processing mit Python
• Mehrere Dateien oder Layer automatisiert verarbeiten
• Verzeichnisse und Datensammlungen durchsuchen
• Geeignete Eingabedaten anhand von Namen oder Dateitypen auswählen
• Schleifen für wiederkehrende Werkzeugaufrufe verwenden
• Ausgaben automatisch benennen und speichern
• Ungeeignete oder fehlerhafte Datensätze überspringen
• Fortschritt und Verarbeitungsergebnisse protokollieren
• Batch-Prozesse testen und optimieren
Modul 18: Eigene Processing-Skripte entwickeln
• Aufbau eines Processing-Skriptalgorithmus
• Eingabe- und Ausgabeparameter definieren
• Vektorlayer, Felder, Zahlen und Dateipfade als Parameter verwenden
• Programmlogik in der Prozessmethode umsetzen
• Fortschritts- und Statusinformationen ausgeben
• Ergebnisse an das Processing-Framework zurückgeben
• Skripte in der Processing-Toolbox bereitstellen
• Eigene Werkzeuge dokumentieren und wiederverwenden
Modul 19: Fehleranalyse und Debugging
• Syntax-, Laufzeit- und Datenfehler unterscheiden
• Python- und QGIS-Fehlermeldungen lesen
• Variablen und Zwischenergebnisse kontrolliert ausgeben
• Fehlerquellen durch schrittweises Testen eingrenzen
• Kritische Codebereiche mit try und except absichern
• Aussagekräftige eigene Fehlermeldungen erstellen
• Fehlerhafte Layer, Felder und Dateipfade erkennen
• Skripte mit unterschiedlichen Eingabedaten testen
Modul 20: Best Practices für PyQGIS-Skripte
• Aussagekräftige Variablen- und Funktionsnamen verwenden
• Code in übersichtliche Abschnitte und Funktionen gliedern
• Kommentare gezielt und verständlich einsetzen
• Docstrings für Funktionen und Skripte erstellen
• Python-Codekonventionen berücksichtigen
• Wiederholten Code vermeiden
• Eingaben vor der Verarbeitung validieren
• Abhängigkeiten und Annahmen dokumentieren
• Skripte für spätere Anpassungen wartbar gestalten
Modul 21: Praxisprojekt – Automatisierter QGIS-Workflow
• Einen typischen GIS-Arbeitsablauf auswählen und strukturieren
• Eingabedaten programmgesteuert laden und prüfen
• Features und Attribute auslesen oder verändern
• Geometrische Berechnungen durchführen
• Mehrere Processing-Werkzeuge miteinander verbinden
• Temporäre und dauerhafte Ergebnisse verwalten
• Fehlerbehandlung und Statusmeldungen ergänzen
• Den Ablauf als eigenes Processing-Skript bereitstellen
• Ergebnisse testen, dokumentieren und gemeinsam auswerten
Hands-on learning with expert instructors at your location for organizations.
Master new skills guided by experienced instructors from anywhere.