Skip to content

Instantly share code, notes, and snippets.

@frewsxcv
Forked from oeon/oam.sh
Created January 17, 2012 19:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frewsxcv/1628357 to your computer and use it in GitHub Desktop.
Save frewsxcv/1628357 to your computer and use it in GitHub Desktop.
OAM batch script
#!/bin/sh
export GDAL_TIFF_INTERNAL_MASK=YES
for f in /media/LAR_HD/6Inch/*.tif
do
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 -r average 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