#!/bin/bash GDAL_TILE_PROCESSES=16 GDAL_TILE_ZOOMS=8-14 GDAL_SAMPLING_WARP=cubic GDAL_SAMPLING_TILE=antialias # Create virtual dataset with coordinates gdal_translate -of VRT -a_srs EPSG:4326 -outsize 300% 300% -gcp 2499.0 2055.0 26.69558333333333 56.89803333333333 -gcp 29625.0 1983.0 27.908883333333332 56.924366666666664 -gcp 29577.0 21558.0 27.939783333333335 56.44968333333333 -gcp 2433.0 21591.0 26.743133333333333 56.423116666666665 1915_3verst_de_126k/greif/Reihe_IX_Blatt_6_Ljuzyn_1914_greif.jpg Reihe_IX_Blatt_6_Ljuzyn_1914_greif.vrt # Add cutline to VRT gdalwarp -r $GDAL_SAMPLING_WARP -tps -dstalpha -cutline_srs EPSG:4326 \ -cutline "POLYGON(($(echo -e "2499.0 2055.0\n9232.5 2064.0074958356468\n15946.5 2045.9908384230985\n18445.5 2008.602443087174\n29625.0 1983.0\n29577.0 21558.0\n15966.0 21541.481676846197\n2433.0 21591.0" | \ gdaltransform -tps -output_xy Reihe_IX_Blatt_6_Ljuzyn_1914_greif.vrt | \ awk 'NR==1{first=$0} {printf "%s %s,", $1,$2} END{print " " first}')))" \ Reihe_IX_Blatt_6_Ljuzyn_1914_greif.vrt Reihe_IX_Blatt_6_Ljuzyn_1914_greif.cut.vrt # Generate tiles gdal2tiles.py -r $GDAL_SAMPLING_TILE --xyz -z $GDAL_TILE_ZOOMS -x --processes=$GDAL_TILE_PROCESSES Reihe_IX_Blatt_6_Ljuzyn_1914_greif.cut.vrt Reihe_IX_Blatt_6_Ljuzyn_1914_greif.xyz