Skip to content

Commit

Permalink
add some QOL commands
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaseberle committed Nov 18, 2024
1 parent 2b95360 commit 92c6a8f
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
17 changes: 17 additions & 0 deletions bin/outputFromTileList
Original file line number Diff line number Diff line change
@@ -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"
22 changes: 22 additions & 0 deletions bin/outputRegion
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 92c6a8f

Please sign in to comment.