Last active
September 29, 2015 11:57
-
-
Save oeon/1596954 to your computer and use it in GitHub Desktop.
OAM batch script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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