Skip to main content

Is there an equivalent to Raster Calculator in FME? I am aware of the RasterCellValueCalculator transformer, and the custom made NDVI transformer, but is there also a single transformer to calculate the results of multiple rasters (more than 2) and/or to apply a custom function on these rasters? And, since the Rasters have to be perfectly overlapping, is there also a transformer to reproject and resample an existing raster so that it will copy the properties of the other raster?

Or do I need multiple RasterCellValueCalculator transformers behind one another to get the same result? This somehow does not seem very efficient.

Have you thought about importing arcpy functionalities by using a pythoncaller? That would be one way to do mathematical operations on several rasters...

 

Another way would be to merge all the rasters as seperate bands to a new raster by using the RasterBandCombiner. Once you have that, use a RasterExpressionEvaluator to do your operation on all the bands (which were your rasters).


Yes, it seems the cell calculators only work on two raster features at a time. However, this does not mean you need to stack multiple transformers (or at least, not as many as you'd think). The Group-By option means you can feed as many rasters as you like into one transformer, provided they are identifiable in groups of two. You could easily create such groups using the ModuloCounter transformer.

Basically, if you start with eight rasters, with this technique you could use only three transformers (rather than eight).

Or, as @jneujens suggests, you could merge a number of single-band rasters together into a single raster feature with multiple bands, then use the RasterExpressionEvaluator to sum them together. That's probably the more elegant solution, to be honest.

You can resample rasters with the RasterResampler transformer and reproject them with any reprojector transformer too.


Have you thought about importing arcpy functionalities by using a pythoncaller? That would be one way to do mathematical operations on several rasters...

 

Another way would be to merge all the rasters as seperate bands to a new raster by using the RasterBandCombiner. Once you have that, use a RasterExpressionEvaluator to do your operation on all the bands (which were your rasters).

I do not have ArcGIS. I know however from experience that raster calculator functions in ArcGIS are really easy. I was looking for an FME equivalent of it; I have hundreds of rasters.

 

 


Hi,

 

I just found the RasterBandCalculator transformer in the FME Hub (https://hub.safe.com/transformers/rasterbandcalculator) that performs the type of calculation you refer to, thanks to Dean and Rylan who've worked on this :)

 

 


Hi,

 

I just found the RasterBandCalculator transformer in the FME Hub (https://hub.safe.com/transformers/rasterbandcalculator) that performs the type of calculation you refer to, thanks to Dean and Rylan who've worked on this :)

 

 

I will try it. Thanks for sharing