Skip to main content
I am trying to follow the example here (http://fmepedia.safe.com/articles/How_To/Advanced-cell-color-manipulation-with-RasterCellValueReplacer-and-RasterExpressionEvaluator-dealing-with-color-no-data-values) , which states:

 

 

"Another, more efficient way to change 0,0,0 to 255,255,255 without altering values like 0,0,255.

 

 

All you need is a RasterExpressionEvaluator with an expression set to:

 

if ((Ai0]+AA1]+AA2])==0, 255, A20]); if ((Ai0]+AA1]+AA2])==0, 255, A21]); if ((Ai0]+AA1]+AA2])==0, 255, A22])"

 

 

however, if I insert  that expression into RasterExpressionEvaluator I get this error:

 

"RasterExpressionEvaluator(RasterEvaluationFactory): The INTERPRETATION_LIST clause has 1 entries, whereas the EXPRESSION_LIST clause has 3 entries.  These clauses must have an identical number of entries"

 

 

Is something wrong with the example, or did I misinterpret how I am supposed to implement it?

 

 

Also, is the language being used here TCL? (I could not find any TCL statement on Google that looked similar in style)
I think the documentation has not been updated. Maybe it's applicable to FME 2012 and earlier.

 

In FME 2014, you can specify expressions for each band separately like this.

 

 


Thanks! is the code being used here TCL?
I noticed that the expressions also seem to work without the "@" symbol in the front of the if statments - what is the @ refering to here?
The expressions should be written in FME specific syntax. You can see and choose available parameters, math functions and operators in the Raster Expression editor. Math functions and operators are similar to ones of C language (but are not completely same).

 

See also the help documentation of the ExpressionEvaluator. There are descriptions about almost all the math function and operators.

 

 


The example expression should work on 1 line.

 

I think you chose the wrong intepretation for your inputraster. You might want to reinterpretate the input. (or use seperate lines for the expressions of course)

Reply