40 lines
926 B
Bash
40 lines
926 B
Bash
|
|
#!/usr/bin/env bash
|
||
|
|
set -euo pipefail
|
||
|
|
|
||
|
|
# Extract two comparable map images (z14 and z16) with the same center point.
|
||
|
|
# Uses tileserver-gl static endpoint to avoid local math dependencies.
|
||
|
|
|
||
|
|
LAT="${1:-49.8917}"
|
||
|
|
LON="${2:-10.8917}"
|
||
|
|
STYLE="${3:-europa-detail}"
|
||
|
|
OUT_DIR="${4:-docs/exports}"
|
||
|
|
BASE_URL="${5:-http://127.0.0.1:9983/styles}"
|
||
|
|
SIZE="${6:-256x256}"
|
||
|
|
|
||
|
|
mkdir -p "$OUT_DIR"
|
||
|
|
|
||
|
|
Z14_FILE="$OUT_DIR/bamberg_innenstadt_z14.png"
|
||
|
|
Z16_FILE="$OUT_DIR/bamberg_innenstadt_z16.png"
|
||
|
|
META_FILE="$OUT_DIR/bamberg_tile_compare.txt"
|
||
|
|
|
||
|
|
Z14_URL="$BASE_URL/$STYLE/static/$LON,$LAT,14/$SIZE.png"
|
||
|
|
Z16_URL="$BASE_URL/$STYLE/static/$LON,$LAT,16/$SIZE.png"
|
||
|
|
|
||
|
|
curl -fsS "$Z14_URL" -o "$Z14_FILE"
|
||
|
|
curl -fsS "$Z16_URL" -o "$Z16_FILE"
|
||
|
|
|
||
|
|
cat > "$META_FILE" <<EOF
|
||
|
|
center_lat=$LAT
|
||
|
|
center_lon=$LON
|
||
|
|
style=$STYLE
|
||
|
|
size=$SIZE
|
||
|
|
z14=static
|
||
|
|
z16=static
|
||
|
|
z14_url=$Z14_URL
|
||
|
|
z16_url=$Z16_URL
|
||
|
|
EOF
|
||
|
|
|
||
|
|
echo "Created: $Z14_FILE"
|
||
|
|
echo "Created: $Z16_FILE"
|
||
|
|
echo "Metadata: $META_FILE"
|