[GRASS-user] convert many files together at once

Markus Neteler neteler at osgeo.org
Fri May 11 10:27:58 EDT 2012


On Fri, May 11, 2012 at 10:23 AM, giannis Nj <netsagief at hotmail.com> wrote:
> is there any option so I can convert many files or a folder (for example,
> 500 images from .asc to .tif) together at once,

gdalwarp can do that well:

RES=10.0
BIGTIFF="-co BIGTIFF=YES"

# in megabytes
CACHE="--config GDAL_CACHEMAX 8000 -wm 8000"

LIST="`ls ??????.tif`"

# fix some no data on the fly
# for reprojection, using -r and -tr (don't use otherwise)
gdalwarp $CACHE $BIGTIFF -srcnodata 65535 -dstnodata 65535 -r bilinear
-tr $RES $RES $LIST out_$RES.tif
gdaladdo out_$RES.tif 2 4 8 16 32


> so that they will have matching color analysis?

This would require histogram matching.

Best
Markus


More information about the grass-user mailing list