From 4e7697e73a1abb9796b70070d36bd4f861e607a4 Mon Sep 17 00:00:00 2001 From: "s0wlz (Matthias Puchstein)" Date: Mon, 15 Dec 2025 21:11:56 +0100 Subject: [PATCH] Add setup_dirs.sh for default raw/archives layout --- AGENTS.md | 1 + README.md | 1 + setup_dirs.sh | 26 ++++++++++++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 setup_dirs.sh diff --git a/AGENTS.md b/AGENTS.md index 10c31fd..cd70552 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -9,6 +9,7 @@ ## 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`. +- Prepare the directory tree (raw/archives/work/exports): `bash setup_dirs.sh`. - 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/`; legacy `raw_dop/jp2/` still works). - Refresh VRT manually if needed: `gdalbuildvrt work/dgm.vrt raw/dgm1/*.tif` (legacy: `raw_dgm1/*.tif`). diff --git a/README.md b/README.md index 15678e1..e816de2 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ This repository converts DGM1 elevation tiles into Unity-ready 16-bit PNG height - Create a project venv: `uv venv && source .venv/bin/activate`. - Install dependencies from `pyproject.toml`: `uv sync` (generates `uv.lock`; warning-free with dependency-groups). - If wheels fail to resolve, ensure system GDAL is present (e.g., `brew install gdal` or `apt-get install gdal-bin libgdal-dev`), then rerun `uv sync`. +- Create the default directory tree (inputs/archives/outputs): `bash setup_dirs.sh`. ### Repository Layout - `raw/` — preferred working inputs (not versioned): `raw/dgm1/`, `raw/dop/jp2/`, `raw/citygml/lod1/`, `raw/citygml/lod2/`. Legacy directories (`raw_dgm1/`, `raw_dop/`, `raw_3dgeb_lod1/`, `raw_3dgeb_lod2/`) are still honored by the scripts. diff --git a/setup_dirs.sh b/setup_dirs.sh new file mode 100644 index 0000000..76fea74 --- /dev/null +++ b/setup_dirs.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Create the default directory layout for GeoData inputs/outputs. +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +DIRS=( + "$ROOT/raw/dgm1" + "$ROOT/raw/dop/jp2" + "$ROOT/raw/citygml/lod1" + "$ROOT/raw/citygml/lod2" + "$ROOT/archives/dgm1" + "$ROOT/archives/dop" + "$ROOT/archives/citygml/lod1" + "$ROOT/archives/citygml/lod2" + "$ROOT/work" + "$ROOT/export_unity/height_png16" + "$ROOT/export_unity/ortho_jpg" +) + +for dir in "${DIRS[@]}"; do + mkdir -p "$dir" +done + +echo "Created default directories:" +printf ' - %s\n' "${DIRS[@]}"