[FWTools] Fwd: Help - It´s possible to make raster calculations with GDAL library?

Frank Warmerdam warmerdam at pobox.com
Wed Feb 3 18:33:24 EST 2010


Cecília Cerdeira wrote:
> Hi!
> 
> I have two operations to solve and I would like to know it it's possible 
> to make those operations by using GDAL libraries/ FWTools.
> 
> 
> *First operation:* Make a division between 2 rasters something like a 
> typical "RASTER CALCULATOR" on a GIS environment.

Cecília,

The usual approach suggested for such an operation is to use the
numpy Python scripting environment to operate on images as arrays.
A relatively simple example of something vaguely similar is available
at:

   http://svn.osgeo.org/gdal/trunk/gdal/swig/python/samples/classify.py

Conveniently FWTools includes Python with the necessary addons for this
to work.

> *
> Second operation:* Based on a raster mask (5x5) calculate statistic 
> values on a raster with a bigger resolution (1x1).

Generally you would need to write your own C/C++ program to do this,
using GDAL for raster data reading and writing.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the FWTools mailing list