Skip to main content
Question

Equivalent to Raster Calculator to calculate multiple rasters (more than 2)


wolters
Contributor
Forum|alt.badge.img+6

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.

5 replies

jneujens
Forum|alt.badge.img
  • June 29, 2017

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).


mark2atsafe
Safer
Forum|alt.badge.img+43

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.


wolters
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • June 30, 2017
jneujens wrote:

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.

 

 


lefred06
Contributor
Forum|alt.badge.img+8
  • Contributor
  • June 8, 2018
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 :)

 

 


wolters
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • June 12, 2018
lefred06 wrote:
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

 

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings