Skip to main content
Solved

Combining rasters (adding bands)


Forum|alt.badge.img

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

Best answer by takashi

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.

View original
Did this help you find an answer to your question?

4 replies

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • October 5, 2016

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

 

 

 


daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • October 5, 2016

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.


takashi
Influencer
  • Best Answer
  • October 6, 2016

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.


Forum|alt.badge.img
  • Author
  • October 12, 2016

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!


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