Skip to main content
Question

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

  • June 29, 2017
  • 5 replies
  • 203 views

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.

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.

5 replies

jneujens
Forum|alt.badge.img
  • 189 replies
  • 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+56
  • Safer
  • 2554 replies
  • June 29, 2017

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
  • 26 replies
  • June 30, 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).

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+10
  • Contributor
  • 12 replies
  • 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
  • 26 replies
  • June 12, 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 :)

 

 

I will try it. Thanks for sharing