QC of Danish DHM hydro adjustment objects (DHMTilpasninger). This tool processes DHM linje and hestesko (horseshoe) features by calculating consequences of sea level changes with integrated progress tracking.
The specification of the DHMTilpasninger is found in the GeoDK spec here.
This recipe works for conda, miniconda, mamba or micromamba. Just replace the executable conda below with whatever you are using.
-
Install package manager (if not already installed):
See installation instructions for conda/miniconda or mamba/micromamba
-
Create the environment:
conda env create -f environment.yml
-
Activate the environment:
conda activate dhm-hydro-qc
After installation and environment activation, the dhm-hydro-qc command-line tool is available.
The tool provides two main commands for processing different DHMTilpasning feature types:
dhm-hydro-qc dhmlinje <dhmlinje-file> <dtm-file> <simsearise-file> <output> [output-flooded-areas]Arguments:
dhmlinje-file: Path to input DHMLinje vector filedtm-file: Path to DTM raster filesimsearise-file: Path to sim-searise raster fileoutput: Path to output vector file for processed featuresoutput-flooded-areas: (Optional) Path to output vector file for flooded area geometries
Examples:
# Without flooded areas output
dhm-hydro-qc dhmlinje \
input_linje.fgb \
dtm.tif \
searise.tif \
output_linje.fgb
# With flooded areas output
dhm-hydro-qc dhmlinje \
input_linje.fgb \
dtm.tif \
searise.tif \
output_linje.fgb \
flooded_areas_linje.fgbdhm-hydro-qc dhmhestesko <dhmhestesko-file> <dtm-file> <simsearise-file> <output> [output-flooded-areas] [OPTIONS]Arguments:
dhmhestesko-file: Path to input DHMHestesko vector filedtm-file: Path to DTM raster filesimsearise-file: Path to sim-searise raster fileoutput: Path to output vector file for processed featuresoutput-flooded-areas: (Optional) Path to output vector file for flooded area geometries
Options:
--max-profile-sample-dist FLOAT: Maximum distance between samples along the horseshoe profile (default: 0.2)
Examples:
# Without flooded areas output
dhm-hydro-qc dhmhestesko \
input_hestesko.fgb \
dtm.tif \
searise.tif \
output_hestesko.fgb
# With flooded areas output
dhm-hydro-qc dhmhestesko \
input_hestesko.fgb \
dtm.tif \
searise.tif \
output_hestesko.fgb \
flooded_areas_hestesko.fgb
# With custom sampling distance
dhm-hydro-qc dhmhestesko \
input_hestesko.fgb \
dtm.tif \
searise.tif \
output_hestesko.fgb \
flooded_areas_hestesko.fgb \
--max-profile-sample-dist 1.0- dhmlinje-file / dhmhestesko-file: Input vector file (e.g., FlatGeobuf)
- dtm-file: Digital Terrain Model (DTM) raster file. Must have at least same bbox as input vector.
- simsearise-file: Simulated sea level rise raster file. Must have at least same bbox as input vector.
- output: Output file for processed features. For now always FlatGeobuf
- output-flooded-areas: Output file for flooded area geometries. For now always FlatGeobuf
--max-profile-sample-dist FLOAT: Maximum distance between samples along the horseshoe profile (default: 0.2) - dhmhestesko only--version: Show the version and exit--help: Show help message and exit
# General help
dhm-hydro-qc --help
# Help for specific commands
dhm-hydro-qc dhmlinje --help
dhm-hydro-qc dhmhestesko --help-
Install package manager (if not already installed):
See installation instructions for conda/miniconda or mamba/micromamba
-
Create the environment:
conda env create -f environment-dev.yml
-
Activate the environment:
conda activate dhm-hydro-qc-dev
-
Install pre-commit hooks:
pre-commit install
# For users
make install
# For developers
make install-devpytest
# or
make testblack src tests
ruff check --fix src tests
# or
make formatruff check src tests
mypy src
# or
make lintcd docs && make html
# or
make docsdhm-hydro-qc/
├── src/
│ └── dhm_hydro_qc/ # Main package code
│ ├── __init__.py
│ ├── cli.py # Command-line interface
│ ├── geometry.py # Geometry processing functions
│ ├── io.py # Input/output operations
│ ├── pipeline.py # Pipeline orchestration
│ ├── processing.py # Core processing logic
│ └── py.typed # PEP 561 marker for type hints
├── tests/ # Test files
│ ├── conftest.py
│ ├── test_geometry.py
│ ├── test_io.py
│ ├── test_pipeline.py
│ └── test_processing.py
├── docs/ # Documentation
├── notebooks/ # Jupyter notebooks for analysis
├── scripts/ # Utility scripts
│ └── example_script.py
├── .gitignore # Git ignore rules
├── .pre-commit-config.yaml # Pre-commit hooks
├── environment.yml # Conda environment (production)
├── environment-dev.yml # Conda environment (development)
├── pyproject.toml # Project configuration
├── Makefile # Convenience commands
└── LICENSE # License file
See LICENSE file for details.