[gdal-dev] Re: 254 into 255

Hermann Peifer peifer at gmx.eu
Fri Oct 28 02:52:04 EDT 2011


On 27/10/2011 14:48, Chaitanya kumar CH wrote:
> However it [gdalbuildvrt] doesn't support complex sources..

Chaitanya, could you perhaps elaborate on the above statement?


joolek,

About the batch-processing of 3000 files: in my 
Linux/Bash/GDAL-from-trunk environment, I would do something like 
indicated below.

Hope this helps, Hermann

for f in path/to/mytiffs/*.tif; do
   gdal_translate -of vrt $f /dev/stdout |
   awk '
     BEGIN { lut = "<LUT>0:0,253:253,254:255</LUT>" }
     { gsub(/SimpleSource>/, "ComplexSource>") }
     $1 == "</ComplexSource>" { $0 = lut ORS $0 }
     { print }' > tmp.vrt
   gdal_translate tmp.vrt ${f%.tif}_modified.tif
done


More information about the gdal-dev mailing list