Homework 03: Ground filtering
Deadline is 2020-01-20 13:00.
Late submission? 10% will be removed for each day that you are late.
20% of final marks
You’re allowed for this assignment to work in a group of 2 (and thus submit only one solution for both of you). If you prefer to work alone it’s also fine.
- Overview
- Data and code skeleton
- Parameters
- Allowed python libraries
- File formats and visualisation
- Good to know
- The report to submit
- Marking
- What to submit and how to submit it
Overview
In this assignment you need to:
- automatically classify part of the AHN3 point cloud into a ground and a non-ground part using ground filtering (as described in Section 12.4 of the book),
- use nth point cloud thinning to speed up processing times (Section 12.2),
- make rasters from the ground points using IDW and TIN interpolation (Sections 4.3.2 and 4.3.3).
- compare your ground rasters with the official AHN3 DTM rasters.
Data and code skeleton
The zip file for this assignment contains:
geo1015_hw03.py
is the main(). You are not allowed to modify this file!my_code_hw03.py
is where all your code should go. You have to complete the filter_ground() function.params.json
file that contains the parameters to be used by your program (see next section)example_raster_output.asc
example raster output fileahn3/rural.las
input point cloud with just hills and trees. (The original AHN3 file contains the classification but we removed it from the file.)ahn3/urban.las
input point cloud of an urban area. (The original AHN3 file contains the classification but we removed it from the file.)
For the last step of the assignment, ie comparing your results to the official AHN3 DTM raster, you will need to download the AHN3 0.5 meter DTM raster from the AHN3 download page. The tiles that you need are 40bn2 and 37fz1 in the GeoTIFF format.
Parameters
The params.json
file in the zip contains all the parameters that are user configurable. This way there is no need to hardcode any parameters in your python files.
The geo1015_hw03.py
script reads this file and passes its contents as a dictionary to the filter_ground() function that you need to implement.
It contains the following parameters:
input-las
: path to input .las file,thinning-factor
: thinning factor, ie the “n” in the nth point thinning method,gf-cellsize
: cellsize for the initial grid that is computed as part of the ground filtering algorithm,gf-distance
: distance threshold used in the ground filtering algorithm,gf-angle
: angle threshold used in the ground filtering algorithm,idw-radius
: radius to use in the IDW interpolation,idw-power
: power to use in the IDW interpolation,output-las
: path to output the .las file that contains your ground classification,grid-cellsize
: cellsize of the output grids,output-grid-tin
: filepath to the output grid with TIN interpolation,output-grid-idw
: filepath to the output grid with IDW interpolation
All parameters have reasonable default values. You are encouraged to experiment with different values during development. All distances are in data units (meters in our case).
Allowed python libraries
Apart from the standard Python libraries you may only use:
- laspy,
- numpy,
- startin (see that simple example to get started)
- the KDtree from scipy.
File formats and visualisation
For point clouds you will use the industry standard LAS file format. Use the laspy library to read and write. You can visualise a LAS file with CloudCompare or Displaz, both open-source software.
For visualising the TIN that is needed in the ground filtering algorithm, you can use the OBJ format.
The startin library offers a write_obj()
method that makes this very easy.
Visualise with CloudCompare, MeshLab or Displaz.
The raster files that you need to create should be in the Esri ASCII raster format (.asc), see its full specifications.
It’s a simple ASCII/text file that can be easily created with Python, and QGIS reads it natively.
See the included example_raster_output.asc
for an example.
Good to know
- Be aware of any border artefacts in the TIN used for ground filtering. Try to minimise these.
- Visualise your intermediate results! For instance use the OBJ export from startin to debug the ground filtering algorithm.
- To ensure that your output is valid, make sure to test it with a visualisation software.
- For the comparison between your raster output and the official AHN3 one you may use QGIS. The rest needs to be implemented in python.
- Notice that the .asc file format does not support a CRS. We expect the coordinates that you write to be in the same CRS as the input (EPSG:7415).
- Make proper use of the NODATA value in the .asc files that you write, eg do not interpolate in areas where this does not make sense.
The report to submit
You need to submit a very simple report explaining briefly how you implemented the assignment, and how your best results compare to the official AHN3 DTM raster.
We expect maximum 3 pages for this.
Marking
Marks | |
---|---|
followed all rules (names, functions, etc.) and runs w/o modifications | 1 |
ground filtering | 3 |
TIN interpolation | 1 |
IDW interpolation | 1 |
No border artefacts | 1 |
report quality/clarity | 3 |
What to submit and how to submit it
You have to submit a total of 6 files (you can put them in a ZIP file):
- the Python file
my_code_hw03.py
, where your name, and that of your colleague, is clearly identified at the top of the file. - report in PDF format (please no Word file)
urban-idw.asc
, IDW interpolation output for urban.las.rural-idw.asc
, IDW interpolation output for rural.las.urban-tin.asc
, TIN interpolation output for urban.las.rural-tin.asc
, TIN interpolation output for rural.las.
For all the .asc
files the cellsize must be 0.5m, the other parameters (search circle, power) are up to you, try to get the best results you can!
Do not submit your assignment by email, but upload the requested files to this Dropbox file request page. Make sure that you put the full name of one of the member of the team (only one is sufficient). You’ll get a confirmation email when everything has been successfully uploaded, keep it in case things go wrong.
[last updated: 2019-12-17]