Skip to main content
Solved

Combine raster data pixel values

  • February 8, 2017
  • 6 replies
  • 136 views

Forum|alt.badge.img

Dear FME-Users,

 

 

I’ve 3 input rasters with the same CRS, extension and resolution.

 

 

The aim is to get 1 output raster by combining all pixel values.

 

 

For each pixel the highest value from the import rasters should be used.

 

 

In the attachment you’ll find 3 rasters. The color cyan is “low” and the colors to red are “higher”.

 

 

Do you have an idea?

 

 

Thank you so much.

 

 

Best regards!

 

 

Konrad

Best answer by takashi

Hi @abu_de_bdlq_16, fortunately the three rasters have exactly same extents, resolution, and palette, and also the palette entry is ordered by color - i.e. from cyan (low) to red (high). In this condition, I think the RasterExpressionEvaluator would be a good solution, as the articles @itay linked describe. e.g.

Result:

In FME 2017, the RasterMosaicker could also be another solution. Coming soon :-)

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.

6 replies

Forum|alt.badge.img+7

Hi @abu_de_bdlq_16

 

I think the way to go is to split the raster into cells and calculate the with the StatisticsCalculator the maximum value per row / column combination (group by). This maximum value can then be used to create the final raster.

This is just a possible solution. I am sure others (@takashi) have better / more readable solutions.

 


itay
Supporter
Forum|alt.badge.img+18
  • Supporter
  • February 8, 2017

Hi @abu_de_bdlq_16,

I would have a look at the RasterCellValueCalculator or the RasterExpressionEvaluator.

This is an efficient way to calculate on rasters.

Some articles on the matter are:

https://knowledge.safe.com/articles/1272/simple-examples-using-the-rasterexpressionevaluato.html

https://knowledge.safe.com/articles/1222/combining-rasters-with-the-rasterexpressionevaluat.html

https://knowledge.safe.com/articles/1226/using-conditions-with-the-rasterexpressionevaluato.html

Hope this helps.


takashi
Celebrity
  • Best Answer
  • February 8, 2017

Hi @abu_de_bdlq_16, fortunately the three rasters have exactly same extents, resolution, and palette, and also the palette entry is ordered by color - i.e. from cyan (low) to red (high). In this condition, I think the RasterExpressionEvaluator would be a good solution, as the articles @itay linked describe. e.g.

Result:

In FME 2017, the RasterMosaicker could also be another solution. Coming soon :-)


jdh
Contributor
Forum|alt.badge.img+40
  • Contributor
  • February 8, 2017

In FME 2016 and earlier I would use the rasterBandCombiner to merge the files into one raster followed by a RasterExpressionEvaluator to get the max value of the 3 bands.

In FME 2017 I would look at the RasterMosaicker with overlapping values set to Max


Forum|alt.badge.img
  • Author
  • February 8, 2017

Thank your very much @takashi, now it works. I thank also @jeroenstiers, @itay and @jdh for your support. :)

Best regards!

Konrad


itay
Supporter
Forum|alt.badge.img+18
  • Supporter
  • February 8, 2017

Hi @abu_de_bdlq_16, fortunately the three rasters have exactly same extents, resolution, and palette, and also the palette entry is ordered by color - i.e. from cyan (low) to red (high). In this condition, I think the RasterExpressionEvaluator would be a good solution, as the articles @itay linked describe. e.g.

Result:

In FME 2017, the RasterMosaicker could also be another solution. Coming soon :-)

I wonder if the mozaiker in 2017 will be able to do that since the calculations will only affect the overlap area and not the all raster extent.