scripts/mapper.sh
2016-06-18 15:59:11 +02:00

39 lines
914 B
Bash
Executable File

#!/bin/bash
#
# *NOTE* for first run, you have to do something like
#
# +---------------------------------------------+
# | ~ # touch /home/minetest/mapshots/daily.png |
# +---------------------------------------------+
#
# first.
set -e
mapperdir="/home/minetest/tools/minetestmapper"
cddir="/var/www/files/mapshots"
tiles="$cddir/tiles"
sourcedir="/var/minetest/illuna_world"
main="$cddir/daily.png"
klein="$cddir/daily_small.jpg"
tarfile="$cddir/daily.tar.bz2"
date=$(date "+%d-%m-%Y")
cd $cddir
cp -r $main $cddir/world_$DATE.png
rm -r $main
cd $mapperdir
./minetestmapper --geometry -10000:-5000+20000+20000 --bgcolor '#c7c7c7' --drawalpha --drawscale -i $sourcedir -o $main
cd $cddir
mogrify -resize 1000 -format jpg -quality 100 $main
mv daily.jpg daily_small.jpg
tar -cvjf $tarfile daily.png
python /home/minetest/tools/gdal2tiles-leaflet/gdal2tiles.py -l -p raster -z 0-10 -w none $main $tiles