[gdal-dev] Batch Processing for gdal_calc.py

Swapnil Chaudhari swapsslan at gmail.com
Fri May 11 00:29:30 EDT 2012


Dear All,

I would like to get your advise on running gdal_calc using shell.
I am finding it difficult, mostly because the command requires you to
define what  -A stands for etc. which is quite different from
gdal_translate or such similar tools, so is the case with Raster
package in R.

I wish to scale all the temperature ascii grids that I have for quite
a few number of folders.

I wrote following sh file

for f in *.tif
do
  echo "Processing $f"
  gdal_calc -A $f --outfile=$f_scaled.asc --calc=A/10
done


However, I am making a mistake somewhere, it does not read above
script as a command. I wish to divide all the rasters with 10 and also
equally wish to make all output files extent as "-projwin -180.0 90.0
180.0 -60.0" and column 720 with rows 300

I would be really thankful if you can give some suggestion on this.

Thanks a ton.

Swapnil Chaudhari

  o__
 _> /__
(_) \(_)....... live healthy


More information about the gdal-dev mailing list