# Geodata Download Configuration for Trier Digital Twin Project
# Generated: 2026-01-23
# Data Source: Geobasis Rheinland-Pfalz (geobasis-rlp.de) + HydroSHEDS

[project]
name = "Trier Digital Twin - Geodata Collection"
description = "VR flood simulation and climate impact assessment"
coordinate_system = "ETRS89/UTM32"
vertical_datum = "DHHN2016"
region = "Stadt Trier and surrounding area"

[download.geobasis_rlp_de]
base_url = "https://geobasis-rlp.de/data"
output_directory = "raw/geo_rlp"
parallel_downloads = 4
retry_attempts = 3
timeout_seconds = 300
verify_ssl = true
user_agent = "TrierDigitalTwin/1.0"
ca_bundle = "certs/geobasis-ca.pem"

[download.hydrosheds_org]
base_url = "https://data.hydrosheds.org/file"
output_directory = "raw/hydrorivers"
parallel_downloads = 4
retry_attempts = 3
timeout_seconds = 300
verify_ssl = true

# Define tile range presets that datasets inherit from
[tile_ranges.range_1km]
description = "1x1km tiles covering full area"
x_start = 324
x_end = 339
x_step = 1
y_start = 5506
y_end = 5521
y_step = 1

[tile_ranges.range_2km]
description = "2x2km tiles covering full area"
x_start = 324
x_end = 338
x_step = 2
y_start = 5506
y_end = 5520
y_step = 2

# Digital Ground Model (bare earth terrain)
[datasets.dgm1]
enabled = true
name = "Digital Ground Model"
download = "geobasis_rlp_de"
tile_range = "range_1km"
resolution = "1m"
format = "GeoTIFF"
url_template = "{base_url}/dgm1/current/tif/dgm01_32_{x}_{y}_1_rp.tif"
priority = 1
output_subdir = "dgm1"

# Digital Surface Model (includes buildings/vegetation)
[datasets.dom1]
enabled = true
name = "Digital Surface Model"
download = "geobasis_rlp_de"
tile_range = "range_1km"
resolution = "1m"
format = "GeoTIFF"
year = 2020
url_template = "{base_url}/dom1/current/tif/dom1_32_{x}_{y}_1_rp_2020.tif"
priority = 2
output_subdir = "dom1"

# 3D Building Models (CityGML LoD2)
[datasets.geb3dlo]
enabled = true
name = "3D Buildings LoD2"
download = "geobasis_rlp_de"
tile_range = "range_2km"
resolution = "LoD2"
format = "CityGML"
url_template = "{base_url}/geb3dlo/current/gml/LoD2_32_{x}_{y}_2_RP.gml"
priority = 2
output_subdir = "citygml/lod2"
notes = "Semantically rich building models with roof structures"

# Orthophotos (aerial imagery)
[datasets.dop20]
enabled = true
name = "Orthophotos 20cm"
download = "geobasis_rlp_de"
tile_range = "range_2km"
resolution = "20cm"
format = "JPEG2000"
year = 2023
priority = 3
output_subdir = "dop20"

[[datasets.dop20.files]]
type = "image"
url_template = "{base_url}/dop20rgb/current/jp2/dop20rgb_32_{x}_{y}_2_rp_2023.jp2"

[[datasets.dop20.files]]
type = "worldfile"
url_template = "{base_url}/dop20rgb/current/jp2/dop20rgb_32_{x}_{y}_2_rp_2023.j2w"

[[datasets.dop20.files]]
type = "metadata"
url_template = "{base_url}/dop20rgb/current/metadata/dop20rgb_32_{x}_{y}_2_rp_2023_meta.xml"

# Building/Object Point Cloud (RGBI)
[datasets.bdom20rgbi]
enabled = true
name = "Building/Object Point Cloud RGBI"
download = "geobasis_rlp_de"
tile_range = "range_2km"
resolution = "20cm"
format = "LAZ"
url_template = "{base_url}/bdom20rgbi/current/las/bdom20rgbi_32_{x}_{y}_2_rp.laz"
priority = 3
output_subdir = "bdom20rgbi"
notes = "RGB + Intensity point cloud for buildings and objects"

# Laser Point Ground/Object (combined LPO/LPG)
[datasets.lpolpg]
enabled = true
name = "Laser Point Ground/Object"
download = "geobasis_rlp_de"
tile_range = "range_1km"
resolution = "High density"
format = "LAZ"
url_template = "{base_url}/las/current/las/lpolpg_32_{x}_{y}_1_rp.laz"
priority = 2
output_subdir = "lpolpg"
notes = "Combined point cloud (LPO/LPG) in one LAZ file"

# HydroRIVERS (for terrain erosion)
[datasets.hydrorivers]
enabled = true
name = "HydroRIVERS Europe and Middle East"
download = "hydrosheds_org"
format = "zip"
unzip = true
output_subdir = "hydrorivers_eu_shp"
priority = 2
url_template = "{base_url}/HydroRIVERS/HydroRIVERS_v10_eu_shp.zip"
notes = "HydroRIVERS Shapefile for erosion of rivers"

# HydroLAKES (for terrain erosion and lake masking)
[datasets.hydrolakes]
enabled = true
name = "HydroLAKES Polygons"
download = "hydrosheds_org"
format = "zip"
unzip = true
output_subdir = "hydrolakes_shp"
priority = 2
url_template = "{base_url}/hydrolakes/HydroLAKES_polys_v10_shp.zip"
notes = "HydroLAKES Shapefile for lake depth and masking"

[processing]
convert_to_mesh = true
generate_lods = true
merge_tiles = false
create_index = true

[processing.optimization]
terrain_lod_levels = [1, 2, 5, 10, 20]
point_cloud_decimation = [1.0, 0.5, 0.25, 0.1]
building_simplification = true

[validation]
check_file_size = true
min_file_size_kb = 10
verify_geotiff_tags = true
verify_crs = "EPSG:25832"
log_missing_tiles = true

[logging]
level = "INFO"
log_file = "./downloads.log"
log_format = "[{timestamp}] {level}: {message}"
report_progress = true
