Skip to main content

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

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.

 


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.


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


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


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

Best regards!

Konrad


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