From 92c6a8ff36590c9b99259fb4de0ee7ab50c07813 Mon Sep 17 00:00:00 2001 From: Jonas Eberle Date: Mon, 18 Nov 2024 19:28:49 +0100 Subject: [PATCH] add some QOL commands --- bin/outputFromTileList | 17 +++++++++++++++++ bin/outputRegion | 22 ++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100755 bin/outputFromTileList create mode 100755 bin/outputRegion diff --git a/bin/outputFromTileList b/bin/outputFromTileList new file mode 100755 index 0000000..b414d8c --- /dev/null +++ b/bin/outputFromTileList @@ -0,0 +1,17 @@ +#!/bin/bash +# Outputs Makefile rules for elevations. +# Ortho4XP uses all surrounding tiles' elevations for generation of a tile. +# The generated rules look like this: +# var/run/neighboursOfTile_+12+123.elevation: var/run/tile_+12+123.elevation ... |$(@D) + +# saner programming env: these switches turn some bugs into errors +set -o errexit -o pipefail -o noclobber -o nounset + +tileListFile="$1" + +tiles="" +while read -r dsf; do + tiles="$tiles z_ao__single_${dsf/dsf/zip}" +done < "$tileListFile" + +echo "$tiles" diff --git a/bin/outputRegion b/bin/outputRegion new file mode 100755 index 0000000..ac6563d --- /dev/null +++ b/bin/outputRegion @@ -0,0 +1,22 @@ +#!/bin/bash +# Outputs Makefile rules for elevations. +# Ortho4XP uses all surrounding tiles' elevations for generation of a tile. +# The generated rules look like this: +# var/run/neighboursOfTile_+12+123.elevation: var/run/tile_+12+123.elevation ... |$(@D) + +# saner programming env: these switches turn some bugs into errors +set -o errexit -o pipefail -o noclobber -o nounset + +minLat="$1" +maxLat="$2" +minLon="$3" +maxLon="$4" + +tiles="" +for lat in $(seq "$minLat" "$maxLat"); do + for lon in $(seq "$minLon" "$maxLon"); do + tiles="$tiles z_ao__single_$(printf "%+03d%+04d" "$lat" "$lon").zip" + done +done + +echo "$tiles"