Quick notes to remember what needs to be done
In this specific case I used Python version 3.6.13 and GDAL installed in an Anaconda3 environment
where I installed GDAL and ran the program in a Jupyter Notebook (version 6.4.3). This is the code:
You can see that there is only one raster of 105 by 96 pixels in this GeoTIFF
and that we imported it in a 105 times 96 Numpy array band1. Part of the arary
is depicted. You can see that the value of the altitude at (0,0) in the upper left corner of the array
equals 667.2732... m and the next one to the right (0,1) equals 664.8215... m etc.
You see we habe a resolution of ca. 200 m per pixel here.
We will do the calculation for each outcrop starting like:
Splitting up the txt lines in single pieces where we are interested in
splitregel (X coordinate), splitregel (Y coordinate), splitregel (elevation):
Now it is easy to calculate the difference in altitude (verschil) between the outcrop (splitregel)
and the altitude of the Glarus thrust (hoogteGU). For the first outcrop it is 1002.91... m (marked blue):
Here below is the full code. This is the file:
berekenenvanhoogteverschil3.ipynb (not for use! only to help you write your own code.)
The final txt file openened in OpenOffice Calc looks like here below, where the differences in altitude
are in column P (marked blue). Swissgrid CH1903 X coordinate (column J), Swissgrid CH1903 Y coordinate
column K), altitude of outcrop (column L), X coordinate of GeoTIFF (column M), Y coordinate of GeoTIFF
(column N), Altitude of DEM (column O) and difference in altitude (column P).