Hi,
If you find it easy to use GDAL, you can use the SystemCaller transformer (in combination with a StringConcatenator ) to execute the GDAL command(s).
Hi Itay and David,
Thank you for your answers!
Itay: Yes I know about the SystemCaller but in this case I'm trying to use FME without any other programs involved.
David: Yes I have already seen the FMEPedia articles (good examples).
I can solve it with the RasterExpressionEvaluator but the expression becomes a little complicated. The color ramp in my example will have this expression (if I'm correct):
if(A[0]<5,((5-A[0])/5)*(255-225) + 225,
if(A[0]>=5 && A[0]<10,((5-A[0])/5)*(225-205) + 205,
if(A[0]>=10 && A[0]<15,((5-A[0])/5)*(205-190) + 190,
if(A[0]>=15 && A[0]<20,((5-A[0])/5)*(190-178) + 178,
if(A[0]>=20 && A[0]<25,((5-A[0])/5)*(178-166) + 166,
if(A[0]>=25 && A[0]<30,((5-A[0])/5)*(166-154) + 154,
if(A[0]>=30 && A[0]<35,((5-A[0])/5)*(154-142) + 142,
if(A[0]>=35 && A[0]<40,((5-A[0])/5)*(142-130) + 130, ((90-A[0])/50)*130))))))))
The result:
Before:

After:

U can extract the colormap and built a new one..
Then u can do the testing and mapping using ie rangemappng. I think it does look better then the expressions in the rasterexpressionevaluater.
the drawback is that this takes a lot of transformers to accomplish...wel at least in my workspace. A workspace that makes density maps to see wether busstops "reach" people and dont make walk them to much.... i just counted: 14 transformers (including mapping) to get it done.
Then reattaching the new map to the raster, another 2 transformers.
....hhmmmm
I did redo it using a tcl caller. A small tcl script in 1 transformer.
Still, the mapping needs to be done.
But looks way better.
Is using tcl also out of the question? Else i'd go for that (or Python)
Gio
As a side note: there is a feature enhancement request at Safe to implement raster support to the fmeobjects Python API. I think this is another good use case for it.
Consider asking Safe to implement these raster classes so that we can do this kind of operations in a PythonCaller rather then messing about with so many transformers :-)
The more who request a feature, the more likely it is to be implemented...
David