Skip to main content

I have a query relating to raster analysis in FME Form using the RasterExpressionEvaluator

 

I want to extract the maximum value of each pixel from a multiband raster, so for example if band 3 has the maximum value compared to bands 1 and 2 for a particular cell, only the value for band 3 for that pixel will be extracted and used in the resulting single band raster.

 

The syntax I believe should work for this is as follows in the attached image but I cannot get it to work. The "maximum/max" functions are unavailable in the transformer and I am thinking that this logic not be usable on data of this type or within this transformer.

 

Can anyone confirm if maximum syntax is workable on this transformer or even have another method of how to go about this?

 

Thanks

Andrew

Hi @apaul​ ,

Available math functions are shown in the Math Functions section in the left pain of the Math Editor window for RasterExpressionEvaluator, and there isn't Maximum or max function unfortunately.

You will have to use an expression with nested if functions to calculate maxmum of Ae0] - A 2] bands, as in: 

@if(A 0]<AÂ1]&&AÂ1]<A:2], A>2], @if(Ae0]<A01], AA1], Am0]))

Alternatively, you can also use RasterBandSeparator and RasterMosaicker (Overlapping Values: Maximum) to transform the multiband raster to single band raster with the maximum values for each pixel. See the attached screenshot.

Note that the Destination Interpretation Type in RasterInterpretationCoercer shoud be modified depending on the original raster band interpretation (bit depth).

rasterbandseparator-rastermosaicker 


Reply