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 && Am0]<10,((5-At0])/5)*(225-205) + 205,
Â
 if(A 0]>=10 && A&0]<15,((5-A&0])/5)*(205-190) + 190,
Â
  if(AÂ0]>=15 && A10]<20,((5-A[0])/5)*(190-178) + 178,
Â
   if(Ap0]>=20 && Ag0]<25,((5-Ap0])/5)*(178-166) + 166,
Â
    if(A60]>=25 && AA0]<30,((5-Ap0])/5)*(166-154) + 154,Â
Â
     if(A 0]>=30 && A 0]<35,((5-A=0])/5)*(154-142) + 142,Â
Â
      if(A10]>=35 && A 0]<40,((5-AA0])/5)*(142-130) + 130, ((90-A40])/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