Move setup/download helpers into scripts/ and update paths

This commit is contained in:
2025-12-15 21:51:39 +01:00
parent 928647d4b6
commit 96734b3c02
6 changed files with 64 additions and 10 deletions

29
scripts/dlscript_dop20.sh Normal file
View File

@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# Download DOP20 assets (JP2/J2W/XML) listed line-by-line in raw/dop20/filelist.txt.
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. && pwd)"
DOP_ROOT="$ROOT/raw/dop20"
LIST="${LIST:-$DOP_ROOT/filelist.txt}"
OUT="$DOP_ROOT/jp2"
if [[ ! -f "$LIST" ]]; then
echo "Missing filelist: $LIST" >&2
exit 1
fi
mkdir -p "$OUT"
while IFS= read -r url; do
[[ -z "$url" || "$url" =~ ^# ]] && continue
fname="${url##*/}"
dest="$OUT/$fname"
if [[ -f "$dest" ]]; then
echo "Exists: $fname"
continue
fi
echo "Downloading $fname"
curl -fL "$url" -o "$dest"
done < "$LIST"
echo "Done. Files in $OUT"

27
scripts/setup_dirs.sh Normal file
View File

@@ -0,0 +1,27 @@
#!/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/dop20/jp2"
"$ROOT/raw/dop/jp2"
"$ROOT/raw/citygml/lod1"
"$ROOT/raw/citygml/lod2"
"$ROOT/archives/dgm1"
"$ROOT/archives/dop20"
"$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[@]}"