Skip to main content
Solved

Combine raster data pixel values


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

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

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+16
  • 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
Contributor
Forum|alt.badge.img+19
  • Contributor
  • 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+28
  • 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+16
  • Supporter
  • February 8, 2017
takashi wrote:

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.

 

 


Reply


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