I'm cropping a large amount of geotiff images by use of geojson masks:
gdalwarp \
-of GTiff \
-co COMPRESS=JPEG \
-co TILED=YES \
-co BLOCKXSIZE=512 \
-co JPEG_QUALITY=85 \
-co NUM_THREADS=ALL_CPUS \
--config GDAL_CACHEMAX 5000 \
-cutline mask.geojson \
-crop_to_cutline \
-dstalpha \
-dstnodata 0.0 \
source.tif out.tif
While this works fine the command takes ages to finish (a file is ~1GB). GDAL_CACHEMAX and NUM_THREAD_ALL did not bring much advantage in speed. Is there something else I can do? For example is it advisable to break the command in several steps? First crop then compress and change blocksize in another step?