Products QGIS Scripts Terrain Analysis Pack
Terrain analysis map showing Canopy Height Model with classified height bands and smooth contour lines

QGIS Script Bundle · 6 Scripts

Terrain Analysis Pack

Six Python scripts for QGIS covering the full terrain analysis workflow for drone survey outputs — coloured hillshade generation, Canopy Height Models, smooth contour lines, flood-level polygon mapping, and lake volume calculation.

Built for drone surveyors who need to go from raw DTM/DSM rasters to client-ready terrain deliverables without manual renderer tweaking. Every script is self-contained, runs in the QGIS Python Console, and adds its output to the project automatically.

$35 USD One-time purchase · 6 scripts · Instant download
Buy on Gumroad

What you get

generate_hillshade.py
generate_chm.py
style_chm.py
generate_contours.py
generate_contour_level_polygon.py
calculate_lake_volume.py
README with setup and dependency notes
Free updates via Gumroad

What the pack covers

Canopy Height Model

DSM minus DTM gives height above ground at every pixel. Auto-resamples when DSM and DTM have different resolutions.

Classified height map

8 height bands from bare ground to tall canopy, with static JPEG export including legend, scale bar, and north arrow — ready for client reports.

Smooth contour lines

Gaussian smoothing removes the triangular mesh artefact from drone DTMs. Chaikin's algorithm rounds the contour lines for clean, cartographic-quality output.

Flood / water-level polygons

Set a target elevation and the script returns filled polygons of every area below that level — ideal for reservoir extent modelling or flood mapping.

Lake / crater volume

Reports cubic metres, litres, and acre-feet. Also exports a depth raster showing how deep each pixel is relative to the reference water surface.

Auto-loads in QGIS

Every script adds its output layer to the QGIS project immediately — no manual drag-and-drop. Each has a built-in HOW TO USE reference block.

Scripts in this pack

generate_hillshade.py

Coloured Hillshade

Generates a publication-ready viridis hillshade from any DTM or DSM. Multidirectional shading removes blind valleys. Auto-downsamples large files. Smart normalisation handles both flat and varied terrain. Outputs RGBA GeoTIFF and a JPEG.

Input: DTM or DSM raster (set ELEVATION_SOURCE to "dtm" or "dsm") Output: {source_name}_hillshade.tif + .jpg added to project
generate_chm.py

Canopy Height Model

Subtracts DTM from DSM to produce a height-above-ground raster. Handles resolution mismatches by auto-resampling. Negative artefacts clamped to zero.

Input: DSM + DTM rasters (layer names contain "dsm" / "dtm") Output: {dtm_name}_chm.tif added to project
style_chm.py

CHM Height Classification

Applies 8 classified height bands to a CHM raster (0–1 m bare ground through 25 m+ canopy). Exports a static JPEG with legend, north arrow, and scale bar.

Input: CHM raster (layer name contains "chm") Output: {chm_name}_classified.tif + .jpg
generate_contours.py

Smooth Contour Lines

Gaussian-smoothes the DTM to remove drone mesh artefacts, generates contour lines, then smooths lines with Chaikin's algorithm. Major contours labelled with elevation in metres.

Input: DTM raster (layer name contains "dtm") Output: {dtm_name}_contours_{interval}m.geojson styled and added to project
generate_contour_level_polygon.py

Water-Level Fill Polygons

Finds every DTM pixel at or below a target elevation and converts them into filled GeoJSON polygons. Useful for flood-level visualisation or identifying low-lying areas.

Input: DTM raster (layer name contains "dtm") Output: {elevation}mt_level_s{tolerance}mt.geojson added to project
calculate_lake_volume.py

Lake / Crater Volume

Computes water storage volume of a lake or crater by comparing DTM elevations inside a boundary polygon against a reference surface derived from the polygon edge. Reports cubic metres, litres, and acre-feet.

Input: Active polygon layer + DTM raster (name contains "dtm") Output: Depth raster + volume report text file

Who it's for

  • Drone survey professionals processing DTM/DSM outputs from WebODM, photogrammetry software, or point cloud pipelines
  • GIS analysts who need clean terrain deliverables (contour maps, height models) without manual rendering
  • Engineers or hydrologists needing reservoir volume or flood extent from drone survey data

Requirements

QGIS 3.28 or newer — (LTR recommended)
numpy, rasterio — bundled with QGIS
scipy, shapely, pyproj — for contour_level_polygon — install via OSGeo4W Shell if needed
DTM + DSM rasters — from drone survey output

How to use it

  1. 1

    Load your DTM and/or DSM rasters into QGIS and check (tick) them in the Layers panel.

  2. 2

    For lake volume: select your boundary polygon layer as the active layer in the Layers panel.

  3. 3

    Open Plugins → Python Console → Show Editor.

  4. 4

    Open the script you need — each has a HOW TO USE block at the top with exact input instructions.

  5. 5

    Adjust parameters at the bottom of the script (elevation threshold, contour interval, etc.).

  6. 6

    Click Run — all outputs are generated and added to your QGIS project automatically.

Built-in instructions in every script

Each script has a HOW TO USE block at the top that documents the active layer, checked layers, output, log path, and configurable parameters — so you always have the reference without needing to open external documentation.

Get the Terrain Analysis Pack

Six scripts, one download. From raw DTM/DSM to client-ready terrain deliverables in minutes.