From e0429b22d350c789bf00301e2a4c45c92ac9874a Mon Sep 17 00:00:00 2001 From: "s0wlz (Matthias Puchstein)" Date: Mon, 15 Dec 2025 20:57:16 +0100 Subject: [PATCH] Refactor exporters with shared GDAL helpers and CLI options --- AGENTS.md | 3 +- README.md | 1 + export_heightmaps.py | 239 +++++++++++++++++++++--------------------- export_ortho_tiles.py | 89 +++++++--------- gdal_utils.py | 71 +++++++++++++ pyproject.toml | 3 +- 6 files changed, 233 insertions(+), 173 deletions(-) create mode 100644 gdal_utils.py diff --git a/AGENTS.md b/AGENTS.md index 30896e4..5f7f0ce 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -13,7 +13,8 @@ - Orthophoto export: `uv run python export_ortho_tiles.py` (requires JP2s under `raw_dop/jp2/`). - Refresh VRT manually if needed: `gdalbuildvrt work/dgm.vrt raw_dgm1/*.tif`. - Inspect a result: `gdalinfo export_unity/height_png16/.png | head` to sanity-check bounds and scaling. - - Expected warning: `Computed -srcwin ... falls partially outside source raster extent` means the DOP coverage is slightly smaller than the tile footprint; edge pixels will be filled with NoData/zeros. Add adjacent JP2s or shrink the requested window if you need to silence it. +- Expected warning: `Computed -srcwin ... falls partially outside source raster extent` means the DOP coverage is slightly smaller than the tile footprint; edge pixels will be filled with NoData/zeros. Add adjacent JP2s or shrink the requested window if you need to silence it. +- Scripts accept CLI overrides (e.g., `--out-dir`, `--jpeg-quality`, `--resample`); run `uv run python