[gdal-dev] Re: Proposal: gdal_muladd.py

Christopher Barker Chris.Barker at noaa.gov
Tue Feb 2 17:09:48 EST 2010


Even Rouault wrote:
> For the record, I had started some time ago to work on something pretty close 
> to Frank's ideas. It was based on a "generic" expression evaluator that could 
> accept C-like expressions ( arithmetic operators, boolean operators, numeric 
> constants, a few predefined maths functions, user variables, user 
> functions, ...). It could be specialized for pixel operations :

> If my memory are corrects, it could do things like :
> * "pixel[ysize-1-y][x]" : to make an horizontal flip of an image
> * "0.30 * source[0].pixel[y][x] + 0.59 * source[1].pixel[y][x] + 0.11 * 
> source[2].pixel[y][x]" : to compute a grey level from RGB
> * "sum(j,-1,1,sum(i,-1,1,abs(pixel[y+j][x+i] - pixel[y][x]))) / 8" : 
> equivalent of the TPI algorithm of gdaldem
> * "abs(source[0].pixel[y][x] - source[1].pixel[y][x])" : for the example 
> discussed in the previous post in this thread ;-)

This sounds a while lot like numpy, which is already supported by the 
python wrappers. Why not just use python (or one of the other supported 
scripting languages, at least if they have something numpy-like) as your 
scripting language?

It might be nice to write a package to make some of the loading and 
setting up easier, but the math stuff is all there in numpy.

-Chris




-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov


More information about the gdal-dev mailing list