X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/33d3964b54662ab6c6aca33a17c177c7ce488bfb..246de2442c7b3d8772a0ed6cfd0859f2ba5d281a:/cookbooks/imagery/files/default/osstvw_make_diffs diff --git a/cookbooks/imagery/files/default/osstvw_make_diffs b/cookbooks/imagery/files/default/osstvw_make_diffs index e47a1946b..636c6f334 100644 --- a/cookbooks/imagery/files/default/osstvw_make_diffs +++ b/cookbooks/imagery/files/default/osstvw_make_diffs @@ -48,6 +48,7 @@ for (( i=0; i<${OSSV_EDITIONS_LENGTH}; i++ )); do # Wait for background jobs to finish wait + echo "Removing empty diffs" # TIF cleanup loop for images which have no diff while IFS= read -r -d $'\0' FILE; do ( FILE_COLOURS=$(identify -quiet -format '%k' "${OSSV_DIFF_NAME}/${FILE}") @@ -62,10 +63,14 @@ for (( i=0; i<${OSSV_EDITIONS_LENGTH}; i++ )); do sleep 1 # this is not optimal, but you can't use wait here running=($(jobs -rp)) done - done < <(find "${OSSV_DIFF_NAME}" -maxdepth 1 -name '*.tif' -size -180000 -printf '%f\0') + done < <(find "${OSSV_DIFF_NAME}" -maxdepth 1 -name '*.tif' -size -180000c -printf '%f\0') + # Wait for background jobs to finish + wait + if [ ! -f "ossv-${OSSV_DIFF_NAME}-combined.vrt" ]; then + gdalbuildvrt -resolution highest -hidenodata "ossv-${OSSV_DIFF_NAME}-combined.vrt" ${OSSV_DIFF_NAME}/*.tif + fi fi done done -echo Now create the VRT and external overview layers -echo 1: gdalbuildvrt -resolution highest -hidenodata diffXYZ.vrt diff/*.tif -echo 2: gdaladdo --config GDAL_CACHEMAX=16000 -ro --config COMPRESS DEFLATE --config COMPRESS_OVERVIEW DEFLATE --config ZLEVEL 9 --config BIGTIFF_OVERVIEW IF_SAFER --config GDAL_TIFF_OVR_BLOCKSIZE 512 -r average ossv-2016-04-combined.vrt 4 16 64 256 1024 4096 +echo Now create external overview layers +echo eg: gdaladdo --config GDAL_CACHEMAX=16000 -ro --config COMPRESS DEFLATE --config COMPRESS_OVERVIEW DEFLATE --config ZLEVEL 9 --config BIGTIFF_OVERVIEW IF_SAFER --config GDAL_TIFF_OVR_BLOCKSIZE 512 -r average ossv-2016-04-combined.vrt 4 16 64 256 1024 4096