#!/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 2118.0 5538.0 22.995916666666666 57.333333333333336 -gcp 9504.0 6336.0 23.326716666666666 57.331716666666665 -gcp 9051.0 10278.0 23.326036666666667 57.236666666666665 -gcp 1761.0 10203.0 23.004 57.22128333333333 1915_3verst_de_126k/greif/Reihe_VII_Blatt_3_Markgrafen_1914_greif.jpg Reihe_VII_Blatt_3_Markgrafen_1914_greif.vrt # Add cutline to VRT gdalwarp -r $GDAL_SAMPLING_WARP -tps -dstalpha -cutline_srs EPSG:4326 \ -cutline "POLYGON(($(echo -e "1861.5 1528.4958356468628\n8409.0 1515.0041643531372\n14952.0 1485.308162132149\n14754.0 10335.001665741254\n1761.0 10203.0" | \ gdaltransform -tps -output_xy Reihe_VII_Blatt_3_Markgrafen_1914_greif.vrt | \ awk 'NR==1{first=$0} {printf "%s %s,", $1,$2} END{print " " first}')))" \ Reihe_VII_Blatt_3_Markgrafen_1914_greif.vrt Reihe_VII_Blatt_3_Markgrafen_1914_greif.cut.vrt # Generate tiles gdal2tiles.py -r $GDAL_SAMPLING_TILE --xyz -z $GDAL_TILE_ZOOMS -x --processes=$GDAL_TILE_PROCESSES Reihe_VII_Blatt_3_Markgrafen_1914_greif.cut.vrt Reihe_VII_Blatt_3_Markgrafen_1914_greif.xyz