Assignment 04

Processing point clouds

Deadline is 2024-01-19@17:00

Late submission? 10% will be removed for each day that you are late (3 days max)

You’re allowed for this assignment to work in a group of 3 (and thus submit only one solution for the three of you). You are free to form a group yourself; if you’re looking for a partner let me know (Hugo), or let others know on Discord. Groups of two are allowed (but not recommended), working alone is not an option.



Overview

In this assignment you need to construct a canopy height model (CHM) of one region in the Netherlands, based on the raw dataset of AHN4 (the point clouds in LAZ format).

A CHM is very similar to a nDSM except that we are only interested in the vegetation/trees, and we ignore the other objects (buildings, bridges, lampposts, busstops, cars, etc.). The CHM is the difference between the DSM of the vegetation and the DTM/ground, thus CHM = DSM-of-vegetation - DTM. You thus obtain a value representing the height of trees, and zero where there are none. If we modify slightly the Figure 1.1 of the terrainbook:

For this assignment, this CHM should be gridded and have a resolution of 50cm.

You can do this assignment using either Python or C++, or a mix of both (one step with Python, another with C++). Using Jupyter is a good idea, you can submit the notebook as report (also as a PDF though).

Step 1: Pick a team to get the AHN4 tile assigned to you

Once you have your team, fill your 3 student numbers in the Google Sheet and I’ll assign you one AHN4 sub-tile (each team gets a different tile).

Step 2: Download and prepare the dataset

  1. Download in LAZ format the AHN4 sub-tile you were assigned to: GeoTiles
  2. Select a 500mX500m area in the tile that is most interesting (mix of buildings, terrains, forest, and some water), and provide its bounding box in the report
  3. Extract the points from your region to the format you want for further processing

Step 3: Extract the ground and make a gridded DTM 50cmX50cm

You first need to filter the ground from the raw points by implementing yourself the Ground filtering with TIN refinement (GFTIN), as described in the book (Section 11.3.1).

Notice that you are not allowed to use the ground classification of AHN4 for this step! All the points should be use, and only the geometry is used to extract the ground.

Once you have extracted the ground points, you need to create a gridded DTM 50cmX50cm using Laplace interpolation, which you need to code yourself too (using the startinpy function is forbidden).

The output should be submitted as the file dtm.tiff (a GeoTIFF file).

Step 4: Extract the vegetation points from AHN4 + create grid

For this step, you are allowed to use the AHN4 classifications (see Appendix B of the book).

How you proceed for this step is totally up to you. There are surely many ways to solve this issue, we want you to be creative and try different approaches that you have learned in the course and/or that you find in the literature. The documentation of lidR on the topic is a great start to understand the pitfalls that you might encounter. While you can implement a β€œpoint-to-raster” algorithm, we think you can do better than this…

You are allowed to use any packages from pip, but you are not allowed to use a package that solves it for you automatically (or lidR; in doubt, just ask on discord). We want you to dive into the problem, and come up with your own solution, and analyse its pros and cons.

The grid you construct should be 50cmX50cm and be called step4.tiff, and it should be submitted too.

Observe that if you want to use the GDAL programs, you can just call them from Python by using Python’s subprocess, here’s a simple example where I call gdalinfo on a file and print out its output:

import subprocess
import sys
result = subprocess.run(
    ["/usr/local/bin/gdalinfo", "./COP30_NL.tiff"], capture_output=True, text=True
)
print(result.stdout)

Step 5: Create the CHM

Subtract the grid from Step 3 to that of Step 4 to obtain the CHM.

Reminder: the final CHM should be gridded, have a resolution of 50cmX50cm, and completely cover your 500mX500m area (without any NO_DATA values).

You need to submit this grid too, call it chm.tiff.

Do I need to write the code for this step?

Here’s the answer:

You cannot use one library that would perform the work automatically for you (for example a deep learning network…).

In doubt? Just ask on discord.

Marking

The following will be evaluated, each part refers to both the code (we will try to run it) and to the report (quality, completeness, analysis).

Criterion Points
code working + GitHub + README.txt 1.0
GFTIN implementation 3.0
Laplace interpolation 2.0
Extraction vegetation 3.0
CHM generation 1.0

What to submit and how to submit it

The submission process will be significantly different from the other assignments: you have to create a private GitHub repository where all the code, data, and the report go.

You need to add before the deadline both me (I’m @hugoledoux) and my colleagues Lukas Beuster (@lukasbeuster) and Gina Stavropoulou (@GinaStavropoulou) as collaborators, you do it this way:

Do not add or modify anything after the deadline! You will get penalised for late submission.

Then you submit the URL of your private GitHub repository in the original Google Sheet form:

The structure of your repository should be as follows (if you have more files before submission, just delete them from the final version):

β”œβ”€β”€ report
β”‚   └── report.pdf 
β”‚   └── (report.ipynb if used)
β”‚   └── (report.tex if used)
β”œβ”€β”€ data
β”‚   └── dtm.tiff
β”‚   └── step4.tiff
β”‚   └── chm.tiff
β”œβ”€β”€ code
β”‚   └── main.py
β”‚   └── myotherunit.py
β”‚   └── ... (any code goes in that folder, you can create new folders in that folder)
└── README.md

Also:

  1. Try to clean your code and comment it a bit and make it usable by others (eg no fixed paths and no hard-coded parameters)
  2. Submit a README.md explaining how to run the code, what input it expects, and where it writes files (for example). Try not hardcoding names of files or parameters.
  3. a report (about ~15-20 pages maximum) in PDF (no Word file please) where you elaborate on:
    • for each step, how did you perform it (in theory, we can read the code so don’t copy it to the report)
    • present the main issues you had and how you fixed them
    • a section describing who-did-what in the team (we will check the git commits to ensure that all shared the workload, all of you have to participate).

[last updated: 2023-12-19 19:12]