import sys
from pathlib import Path
import tiroldem as tdem
Package to download elevation data for the State of Tyrol (Austria) with a spatial resolution of 50 cm. This dataset and all the lower resolution products all are available for free under the CC BY 4.0 license here. There is also a WCS for the 50 cm dataset, which, depending on the goal, might be easier to use than this package.
print(sys.version)
print(tdem.__version__)
3.13.1 | packaged by conda-forge | (main, Dec 5 2024, 21:23:54) [GCC 13.3.0]
0.1.0
Define area of interest
= 25832
crs
= (654360.437,5214275.175)
p1 = (654360.437,5208326.626)
p2 = (664226.125,5208326.626)
p3 = (664226.125,5214275.175)
p4
= [p1, p2, p3, p4] shape
Download individual tiles
= tdem.get_intersecting_tiles(shape, crs=crs)
tiles_per_region
# tiles are returned by region
= "gk-west"
region = tiles_per_region[region]
tiles
# specify output directory
= Path("...")
out_dir
tdem.download_tiles(tiles, out_dir, region)
Merging individual tiles after downloading
Various ways exist to merge individual tiles, which is the reason this is not covered by the package. A simple way is to use gdal_merge.py
included in the gdal command line utilities (which likely are already available if the gdal package is installed in the current python environment): gdal_merge -o dem_merged.tif -n <no_data_value_in> -a_nodata <no_data_value_out> dgm*.tif