Skip to main content
Archived

RasterExpressionEvaluator single equation for all bands

Related products:FME Form
  • September 19, 2018
  • 1 reply
  • 28 views

jdh
Contributor
Forum|alt.badge.img+40

I have a scenario where I have to apply an expression to a raster that is more complicated than can be captured by the RasterSingularCellValueCalculator, but the RasterExpressionEvaluator is complicated because a) there are a lot of bands and b) I don't know in advance the number of bands.

My current workaround is to use a RasterBandSeparator, RasterExpressionEvaluator (using A[0]), RasterBandCombiner sequence.

Bonus points if the expression can reference a list attribute with the list index corresponding to the band number.

Side note, @Value(A:_list{0}.x) works fine in the RasterExpressionEvaluator, but @Value(A:_list{@Value(A:_index}.x) fails to parse.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

jdh
Contributor
Forum|alt.badge.img+40
  • Author
  • Contributor
  • June 10, 2020

Different scenario, similar issue.

 

 

It would be nice if I could enter a single equation referencing A[n] which would be applied to all bands.

In this case I need to apply a dynamic stretch on 8 bands and the equation looks something like this

if(A[0]==0,0,if(A[0]<@Value(A:_!TrimMin),@Value(A:_!Lower),@Value(A:_!Lower)+(@Value(A:_!BitDepth)-@Value(A:_!Lower))/(@Value(A:_!TrimMax)-@Value(A:_!TrimMin))*(A[0]-@Value(A:_!TrimMin))))