Exercises 1: Automatisation#
🚧This part of training platform is under ⚠️construction⚠️ and may not be shared or published! 🚧
Characteristics of the exercise#
Type of trainings exercise:
This exercise can be used in online and presence training.
It can be done as a follow-along exercise or individually as a self-study.
Estimated time demand for the exercise
Relevant Wiki Articles
Aim of the exercise:
Instructions for the trainers#
Trainers Corner
Prepare the training
Take the time to familiarise yourself with the exercise and the provided material.
Prepare a white-board. It can be either a physical whiteboard, a flip-chart, or a digital whiteboard (e.g. Miro board) where the participants can add their findings and questions.
Before starting the exercise, make sure everybody has installed QGIS and has downloaded and unzipped the data folder.
Check out How to do trainings? for some general tips on training conduction
Conduct the training
Introduction:
Introduce the idea and aim of the exercise.
Provide the download link and make sure everybody has unzipped the folder before beginning the tasks.
Follow-along:
Show and explain each step yourself at least twice and slow enough so everybody can see what you are doing, and follow along in their own QGIS-project.
Make sure that everybody is following along and doing the steps themselves by periodically asking if anybody needs help or if everybody is still following.
Be open and patient to every question or problem that might come up. Your participants are essentially multitasking by paying attention to your instructions and orienting themselves in their own QGIS-project.
Wrap up:
Leave time for any issues or questions concerning the tasks at the end of the exercise.
Leave some time for open questions.
Available Data#
The folder is called “ and contains the whole standard folder structure with all data in the input folder and the additional documentation in the documentation folder.
Dataset |
Source |
Descriptions |
---|---|---|
Administrative Boundaries |
The administrative boundaries on level 0-4 for Madagascar can be accessed via HDX provided by OCHA. For this trigger mechanism we provide the administrative boundaries on level 1 (regional level) and 2 (district level) as a shapefile. |
|
Cyclone Tracks |
International Best Track Archive for Climate Stewardship (IBTrACS) |
IBTrACS project is the most complete global collection of tropical cyclones available. It merges recent and historical tropical cyclone data from multiple agencies to create a unified, publicly available, best-track dataset that improves inter-agency comparisons. |
education facilities and health sites |
The POI data (education facilities and health sites) is downloaded using the HOT Export Tool based on OpenStreetMap data. |
|
Population |
The worldpop dataset in raster format provides the estimated total number of people per grid-cell for the year 2020. We will be working with the Constrained Individual countries 2020 dataset at a resolution of 100m. |
Context

Aina is the GIS expert at the Croix-Rouge Malagasy (CRM). With the cyclone season approaching, she knows that time is of the essence once a storm is forecasted. Every hour counts when it comes to protecting communities at risk.
This year, Aina wants to be one step ahead. Instead of manually analyzing cyclone data under pressure, she decides to prepare an automated QGIS model that will help her respond quickly and efficiently.
Her goal:
Build a workflow that automatically estimates exposed populations and infrastructure at risk.

Tasks: Estimating Exposed Population – Aina’s Manual Approach#
Before developing the automated model, Aina used to estimate the exposed population manually whenever a cyclone approached Madagascar. In this task, you will follow the steps she used in the past by working with the historical track of Cyclone Harald, WorldPop raster data, and administrative boundaries.
You will manually buffer the cyclone track, clip the population raster, and calculate exposed population using zonal statistics.
Open QGIS and create a new project by clicking on
Project
->New
Save the project in the “project” folder. To do that click on
Project
->Save as
and navigate to the folder. Name the project “Cyclon_Harald_Exposure”.Load the GeoJOSN file “Harald_2025_Track.geojson” in your project by drag and drop (Wiki Video) .
Reproject the cyclone track to use meters instead of degrees (important for accurate buffering):
In the Processing Toolbox, search for
Reproject Layer
.Input:
Harald_2025_Track
Target CRS:
EPSG:29738
or another meter-based CRS appropriate for Madagascar.Save the result in the
temp
folder as:Harald_Track_Reprojected
Attention
Buffer distances must be calculated in meters. Many datasets (like GeoJSON cyclone tracks) use geographic coordinate systems like EPSG:4326, which measure in degrees — not meters. To correctly calculate a 200 km buffer, we must first reproject the track into a projected CRS that uses meters.
Buffer the cyclone track:
In the Processing Toolbox, search for
Buffer
.Input:
Harald_Track_Reprojected
Buffer distance:
200000
(meters)Segments: Leave default (5)
Dissolve:
Yes
Save output in the
temp
folder as:Harald_Buffer_200km
Reproject the buffer back to EPSG:4326 (to match the raster’s CRS):
In the Processing Toolbox, search for Reproject Layer.
Input: Harald_Buffer_200km_29738
Target CRS: EPSG:4326 – WGS 84
Save the output in the temp folder as: Harald_Buffer_200km_4326
Load the administrative boundaries:
File:
MDG_adm2.gpkg
Add using drag and drop or
Add Vector Layer
.
Load the population raster:
File:
MDG_WorldPop_2020_constrained.tif
Add using
Layer
→Add Raster Layer
.
Clip the population raster using the buffered impact zone:
In the Processing Toolbox, search for
Clip Raster by Mask Layer
.Input raster:
MDG_WorldPop_2020_constrained.tif
Mask layer:
Harald_Buffer_200km
Save output in the
temp
folder as:Harald_Pop_Clip.tif
Calculate total exposed population:
In the Processing Toolbox, search for
Zonal Statistics
.Input vector layer:
MDG_adm2.gpkg
Raster layer:
Harald_Pop_Clip.tif
Statistic to calculate:
Sum
Field prefix: e.g.,
pop_
Save the updated vector layer in the
result
folder as:Harald_Exposed_Population.gpkg
The result will be a new column in the attribute table of the
MDG_adm2.gpkg
layer, showing the total population within the cyclone buffer per district.
Visualise the affected population by classifying the results: Now that Aina has estimated the exposed population in each district, she wants to clearly show the differences across regions on the map. To do this, we’ll apply a graduated classification to the
Harald_Exposed_Population.gpkg
layer using the new population field created by the Zonal Statistics tool.
In the Layers panel, right-click on the layer
Harald_Exposed_Population
and chooseProperties
.Go to the Symbology tab on the left.
At the top of the window, change the style from
Single Symbol
toGraduated
.In the Value drop-down menu, select the field that contains the population sum. It typically starts with the prefix you defined earlier, e.g.
pop_sum
.Set the color ramp to one that suits your map (e.g.
Reds
).Choose a classification mode (e.g.
Quantile
,Natural Breaks
, orEqual Interval
) and select the number of classes (e.g. 5).Click
Classify
to generate the classification.Click
Apply
and thenOK
to display the classified map.
Tip
You can adjust class boundaries or labels by double-clicking on each class entry.
Your results should look something like this: