Hi,
Â
Â
Looks like there is no problem, but the division result will be an integer if both operands were integer values. Therefore, the resultant raster would be a binary image (0 or 1), if every cell value was integer. If your situation was so, consider performing cast an operand of the division operator to floating point value. See also this thread.
Â
How to use the ExpressionEvaluator? (
http://fmepedia.safe.com/CommunityAnswers?id=906a0000000d6XBAAY)
Â
Â
Takashi
Hello, thanks for the reply. I tried your suggestion but it still didn't create an output. However I did the calculations in stand alone ExpressionEvaluators also adding +0.0 value then passed those attributes to my RasterExpression and it created the right result! So my new expression looked like this:
Â
Â
((A>0]-@Value(A:NEWMIN))/@Value(A:DIVIDE))*100
Â
Â
Thanks for the suggestion
Good to hear you accomplish the purpose :-)
Â
Â
Probably this expression can be used to get the same result.
Â
100.0*(A>0]-@Value(A:_band{0}.min))/(@Value(A:_band{0}.max)-@Value(A:_band{0}.min))
Â
Â
The point is that I added "100.0*" to the head of the expression.
Â
Since * and / operators have same precedence, the calculation will be performed from left to right. i.e. firstly 100.0 (floating point number) is multiplied by "(Aq0]-@Value(A:_band{0}.min))", the result will be a floating point number.
Â
And then, the division will be performed with the result, so the final result will also be a floating point number.