diff options
author | Markus Koch <markus@notsyncing.net> | 2020-04-25 16:43:55 +0200 |
---|---|---|
committer | Markus Koch <markus@notsyncing.net> | 2020-04-25 16:43:55 +0200 |
commit | f17bf1ebb0a23206bc37de93dfd49c7b254b6705 (patch) | |
tree | 0d465946f2713741241fdf3c8af71df6277d2d9b /scripts | |
parent | 105dc4d3da821219d8d2a01b17833ead0c7c107f (diff) | |
download | lifomapserver-f17bf1ebb0a23206bc37de93dfd49c7b254b6705.tar.gz lifomapserver-f17bf1ebb0a23206bc37de93dfd49c7b254b6705.tar.bz2 lifomapserver-f17bf1ebb0a23206bc37de93dfd49c7b254b6705.zip |
Remove necessity for php tile resolution script
The conversion script now generates a proper directory
structure with z/y/x coords in the path.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/convert_maps.sh | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/scripts/convert_maps.sh b/scripts/convert_maps.sh index 32ef029..faeea22 100755 --- a/scripts/convert_maps.sh +++ b/scripts/convert_maps.sh @@ -41,7 +41,7 @@ while true; do fi echo " Generating tiles..." - convert $tempfile -crop ${TILESIZE}x${TILESIZE} +adjoin $out/%05d.png + convert $tempfile -crop ${TILESIZE}x${TILESIZE} +adjoin $out/%d.png rm $tempfile @@ -51,3 +51,16 @@ while true; do crop=$(($crop * 2)) zoom=$(($zoom + 1)) done; + +echo "Renaming files..." +for (( z=0; z<=$zoom; z++ )) { + echo "Zoom level $z" + fac=$((2**$z)) + for (( y=0; y<$fac; y++ )) { + outdir="$MAPNAME/$z/$y" + mkdir $outdir + for (( x=0; x<$fac; x++ )) { + mv $MAPNAME/$z/$(($fac * y + $x)).png $outdir/$x.png + } + } +} |