Solved

Combining rasters (adding bands)

  • 5 October 2016
  • 4 replies
  • 20 views

Badge

Hi there,

I have a number of rasters that I want to combine together (same spatial extents, cells, etc.), and in the process accumulate their bands values. I can use the RasterExpressionEvaluator, however I have to use it multiple times to achieve what I want, e.g. 64 rasters into 32 into 16, etc.

Is there a faster way? Thanks!

Amit

icon

Best answer by takashi 6 October 2016, 06:40

View original

4 replies

Badge +22

If I understand correctly, you want the sum off all the input rasters.

 

There are no raster tools that currently allow you do to do that. You may have better luck coercing the rasters to point clouds and using the PointCloudStatisticsCalculator and then converting back to raster

 

 

 

Userlevel 2
Badge +17

Please use the RasterBandCombiner to merge the source rasters into a single multi-band raster, then use the RasterExpressionEvaluator to create a new band whose values are the sum of the source bands. The expression in the evaluator would be: A[0]+A[1]+A[2]... for all the source rasters. Be sure that the Interpretation of the new band is large enough to handle the output values.

Userlevel 2
Badge +17

If the number of rasters which should be combined is fixed, the combination of RasterBandCombiner and RasterExpressionEvaluator would be the way to go, as @DaveAtSafe suggested.

However, if the number of rasters could be different for each run, probably you will have to create a custom transformer to calculate the sum of two rasters repeatedly with the Loop.

Alternatively, if you are allowed to use FME 2017 Beta, the RasterMozaicker in the latest beta does the trick. It has a new option parameter called "Overlapping Values" and you can choose "Sum" as the option.

Badge

Hello all, thanks for the replies. We ended up achieving it using the Loop ( @takashi ), however I'm certainly going to try the 'new way in 2017 once I upgrade, thanks again!

Reply