From cb0ba6d6b5a30a841359e8f370554ee9ac6f760c Mon Sep 17 00:00:00 2001 From: "s0wlz (Matthias Puchstein)" Date: Mon, 15 Dec 2025 21:05:58 +0100 Subject: [PATCH] Adopt raw/archives layout with path-compatible exporters --- .gitignore | 2 ++ AGENTS.md | 8 ++++---- README.md | 13 ++++++------- export_heightmaps.py | 17 +++++++++++++++-- export_ortho_tiles.py | 20 ++++++++++++++++---- gdal_utils.py | 9 +++++++++ 6 files changed, 52 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index e170e00..f579b85 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,8 @@ export_unity/buildings_obj/ # --- Raw downloaded source data (usually too big for git) --- *.zip +raw/ +archives/ # If you DO want to keep small sample tiles in git for CI/tests, # comment out raw_dgm1/ and add a whitelist like: diff --git a/AGENTS.md b/AGENTS.md index 5f7f0ce..10c31fd 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -3,15 +3,15 @@ ## Project Structure & Module Organization - `export_heightmaps.py` is the main pipeline: builds `work/dgm.vrt`, scales heights, and writes `export_unity/height_png16/*.png` plus `export_unity/tile_index.csv`. - `export_ortho_tiles.py` exports orthophotos into `export_unity/ortho_jpg/` using the terrain manifest. -- Raw inputs (`raw_dgm1/`, `raw_dop/`, `raw_3dgeb_lod1/`, `raw_3dgeb_lod2/`) and `work/` intermediates are intentionally untracked; do not commit them. -- `export_unity/` is safe to sync to Unity projects; treat it as generated output. +- Preferred raw layout: `raw/dgm1/`, `raw/dop/jp2/`, `raw/citygml/lod1/`, `raw/citygml/lod2/`; legacy paths (`raw_dgm1/`, `raw_dop/`, `raw_3dgeb_lod*/`) still work. `archives/` can hold untouched downloads/zips. +- `export_unity/` is safe to sync to Unity projects; treat it as generated output. `work/` holds intermediates and is disposable. ## Build, Test, and Development Commands - Create a venv: `uv venv && source .venv/bin/activate`. Install deps: `uv sync` (generates `uv.lock`). - If wheels fail, install system GDAL first (e.g., `brew install gdal` or `apt-get install gdal-bin libgdal-dev`), then rerun `uv sync`. - Heightmap export (rebuilds VRT if absent): `uv run python export_heightmaps.py`. -- 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`. +- Orthophoto export: `uv run python export_ortho_tiles.py` (requires JP2s under `raw/dop/jp2/`; legacy `raw_dop/jp2/` still works). +- Refresh VRT manually if needed: `gdalbuildvrt work/dgm.vrt raw/dgm1/*.tif` (legacy: `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. - Scripts accept CLI overrides (e.g., `--out-dir`, `--jpeg-quality`, `--resample`); run `uv run python