#!/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 1263.0 1809.0 22.226666666666667 57.75 -gcp 16218.0 1809.0 22.676666666666666 57.75 -gcp 16254.0 17175.0 22.676666666666666 57.5 -gcp 1104.0 17121.0 22.226666666666667 57.5 bruno/I-12+13_1915.jpg I-12+13_1915.vrt # Add cutline to VRT gdalwarp -r $GDAL_SAMPLING_WARP -tps -dstalpha -cutline_srs EPSG:4326 \ -cutline "POLYGON(($(echo -e "1188.0 9472.504164353137\n1263.0 1809.0\n10104.0 1806.0\n10113.0 933.0\n15105.0 930.0\n15102.0 1803.0283176013324\n21168.0 1848.026651860078\n20919.0 17141.99000555247\n16254.0 17176.5091615769\n7587.0 17169.011660188782\n7586.25 15093.77581898945\n4360.5 15125.977096057746\n4320.0 17166.011660188782\n1104.0 17121.0" | \ gdaltransform -tps -output_xy I-12+13_1915.vrt | \ awk 'NR==1{first=$0} {printf "%s %s,", $1,$2} END{print " " first}')))" \ I-12+13_1915.vrt I-12+13_1915.cut.vrt # Generate tiles gdal2tiles.py -r $GDAL_SAMPLING_TILE --xyz -z $GDAL_TILE_ZOOMS -x --processes=$GDAL_TILE_PROCESSES I-12+13_1915.cut.vrt I-12+13_1915.xyz