Assignment 03
Visibility in terrains
Deadline is 2023-12-19@17:00
Late submission? 10% will be removed for each day that you are late (3 days max)
This is an individual assignment
- Overview
- Test your program with any DEM in EPSG:7415
- The code to use
- Marking
- What to submit and how to submit it
Overview
The aim of this assignment is to implement the line-of-sight algorithm for gridded DTMs, as described in the book.
You will have to develop a Python function that takes as input 2 locations a and b (given in EPSG:7415 coordinates), and the program must return:
1
: a sees b, and vice-versa0
: no visibility between the 2 points-1
: a and/or b are outside the extent of the dataset-2
: a and/or b are located in ano_data
cell
As input, your program should accept any DTM that is in the Netherlands (EPSG:7415).
Notice that this DTM can contain no_data
values.
You can use a DSM of AHN4 or again use Copernicus GLO-30 gDEM and reproject it.
Your program should work for any GeoTIFF input in that CRS (with different resolutions also), I will test it with different input files.
!!! Notice that you should add +2.0m to the elevation of a, since it acts as a normal person and what they see.
Test your program with any DEM in EPSG:7415
Downloading Copernicus GLO-30 from the official EU website is rather complex, so instead we propose you use OpenTopography.
To reproject them:
gdalwarp -s_srs EPSG:4326+3855 -t_srs EPSG:7415 input.tif output.tif -dstnodata -9999
Notice that -dstnodata -9999
is used to assign no_data
to the “edges” during the reprojection.
The code to use
The help code is in the /hw/03/
folder of the GitLab repository of the course.
Marking
Criterion | Points |
---|---|
followed all rules and compiles/runs without modifications | 1.0 |
handle the case outside spatial extent | 1.0 |
handle the no_data |
1.0 |
works as expected | 7.0 |
What to submit and how to submit it
You have to submit one file: my_code_hw03.py
.
Don’t forget to add your name and student-number at the top of the tile, as the comments tell you.
Oh, and no report is necessary.
Upload the file to this Dropbox page.
[last updated: 2023-12-07 15:12]