[gdal-dev] Batch Processing for gdal_calc.py

Chaitanya kumar CH chaitanya.ch at gmail.com
Fri May 11 01:12:24 EDT 2012


Swapnil,

You missed the --format option with gdal_calc. If you don't mention it, it
assumes the default format, GeoTiff.

Since the operation is simple, you should be able to do that using
gdal_translate using the -scale option. It also has the -projwin option to
select the extents.

On Fri, May 11, 2012 at 9:59 AM, Swapnil Chaudhari <swapsslan at gmail.com>wrote:

> 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
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>


-- 
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120511/d93a6c26/attachment.html


More information about the gdal-dev mailing list