Resit for the assignments

About point clouds, DTMs, and visualisation

Deadline: Friday 10 April 2026 at 8:59 AM (when the exam resit begins)

Late submissions: 10% penalty per day late

This assignment (comprising several steps) is the resit for the three assignments combined and counts for 40% of your final course grade.

This is an individual assignment.



Overview

In this assignment, you will:

  1. Automatically classify a 500 m Ă— 500 m region of the AHN point cloud into ground and non-ground points using the TIN densification algorithm
  2. Generate a raster DTM using Laplace interpolation
  3. Generate a raster nDSM using a method of your choice
  4. Compare your DTM with the official AHN4 DTM
  5. Implement a contouring algorithm to visualize the results

You must use the following Python libraries (contact me first if you want to use others): numpy, startinpy, rasterio, scipy, laspy, fiona, and shapely.

Step 0: Register for the resit and obtain your dataset

Send me an email (h.ledoux@tudelft.nl) to register. I will provide you with a unique AHN tile to ensure each student works with different data.

You must write code and optimize parameters to work best for your specific tile, but your solution should theoretically work for any AHN tile in the Netherlands.

Step 1: DTM and nDSM creation (both at 1mX1m resolution)

Write a Python program that automates all processing steps. Your code must be generalizable to other areas in the Netherlands, so parameters should be configurable (see specifications below).

Since LAZ files can be very large, process only a 500mX500m area centered on the tile center (±250 m in each direction).

Implement the Ground Filtering with progressive TIN Densification (GFTIN) algorithm as described in the terrainbook (Section 11.3.1).

Important: Do not use the existing ground classification in the AHN file. Use all points and rely solely on geometry to extract ground points.

Classify points as ground and use them to generate the DTM with Laplace interpolation. You may not use startinpy’s interpolate() function; you must implement it yourself. However, you can use startinpy’s triangulation and other functions.

Your code must be a file called grid.py with the following input parameters:

Parameter Description
inputfile LAZ file
resolution GFTIN resolution for ground grid
max_dist GFTIN maximum distance parameter
max_angle GFTIN maximum angle parameter

The script must output three files to the working directory:

  1. dtm.tiff – 1mX1m resolution DTM created using Laplace interpolation
  2. ndsm.tiff – 1mX1m resolution nDSM
  3. ground.laz – classified ground points

Example usage:

python grid.py mypc.laz --resolution 20.0 --max_dist 0.5 --max_angle 15.0

Use Python’s argparse module for command-line arguments:

import argparse
parser = argparse.ArgumentParser()
parser.add_argument("ifile", help="Input LAZ file")
parser.add_argument("--resolution", type=float, help="GFTIN resolution")
parser.add_argument("--max_dist", type=float, help="GFTIN maximum distance")
parser.add_argument("--max_angle", type=float, help="GFTIN maximum angle")
args = parser.parse_args()

Your code will be tested with other areas and files.

Step 2: Compare your DTM with the official AHN DTM

Compare your DTM with the official AHN DTM using methods of your choice (existing libraries and software are acceptable). Highlight differences and explain possible causes in your report.

No code submission required for this step—only analysis in the report.

Step 3: Visualization with iso-contours

Implement the algorithm described in “Conversion to isolines” in the terrainbook to generate GeoPackage files of contour lines at full-meter intervals (1.0, 2.0, 3.0 m, etc.).

Present results in the report and submit the code. The Python script viz.py must have the following behavior:

Parameter Description
inputfile GeoTIFF file (DTM)

The script must output a GeoPackage file called isocontours.gpkg with contour lines as features and elevation as an attribute.

Use the “fiona” library (the companion package to rasterio) to create GeoPackage files. It works seamlessly with “shapely”.

Evaluation criteria

Both code (which will be executed) and report (quality, completeness, analysis) will be assessed for each criterion below:

Criterion Points
Report quality 3.0
Ground filtering with TIN densification 2.5
Laplace interpolation 1.5
nDSM generation 1.0
Iso-contour generation 1.0
DTM comparison analysis 1.0

Submission requirements

Submit the following files in a ZIP archive named with your student ID (e.g., 5015199.zip):

  1. All code with the filenames specified above (grid.py, viz.py, etc.)
  2. Report (approximately 20 pages, PDF only—no Word documents) including:
    • Detailed explanation of your approach for each step (beyond what can be inferred from the code)
    • Main challenges encountered and how you resolved them
    • Justification for your chosen GFTIN algorithm parameters
    • Analysis of differences between your DTM and the official AHN DTM
  3. Output files for your 500mX500m study area:
    • dtm.tiff
    • ndsm.tiff

Email the ZIP file to h.ledoux@tudelft.nl before the deadline. For large files, upload to a cloud service and send the link instead.

[last updated: 2026-02-16 10:46]