Skip to content

Instantly share code, notes, and snippets.

@oeon
Last active September 29, 2015 11:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save oeon/1596954 to your computer and use it in GitHub Desktop.
Save oeon/1596954 to your computer and use it in GitHub Desktop.
OAM batch script
#!/bin/sh
for f in $(ls /media/LAR_HD/6Inch/*.tif)
do
export GDAL_TIFF_INTERNAL_MASK=YES
nearblack -co TILED=YES -setmask -nb 0 -of GTiff -o ./prewarp.tif $f
gdalwarp -co TILED=YES -dstalpha -s_srs EPSG: 2229 -t_srs EPSG:4326 prewarp.tif warped.tif
rm prewarp.tif
gdal_translate -co TILED=YES -co JPEG_QUALITY=80 -co COMPRESS=JPEG -co PHOTOMETRIC=YCBCR -b 1 -b 2 -b 3 -mask 4 warped.tif final.tif
rm warped.tif
gdaladdo final.tif 2 4 8 16 32 64 128 256
mv final.tif converted/$(basename ${f})
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment