So FME treats noData values on bands independently. So if you set band 0 NoData to 237, it would identify all pixels with a value of 237, not just 237/28/36.
My recommendation is to use a RasterBandNoDataRemover followed by a RasterExpressionEvaluator with the following expressions
if(A(0]==237 && A 1] ==28 && A 2] ==36, 0, A 0])
if(A(0]==237 && A 1] ==28 && A 2] ==36, 0, A 1])
if(A(0]==237 && A 1] ==28 && A 2] ==36, 0, A 2])
and then a RasterBandNoDataSetter (0).
This will change 237/28/36 only to 0.
Note that weird things happen in the RaterExpressionEvaluator if there is nodata values on the bands, which is why you remove it first.
You can change the conditional to include the alpha band as well, I wasn't sure if that was an and/or condition)
The expression is: if (conditions, pass value, fail value)
so if the condition is met set it to 0, otherwise keep the same value.
Hi @arsi, if you need to replace cell values of original Nodata for all bands with 0, the RasterBandNodataSetter with setting Yes to the Replace Cell Values parameter should work as well. You can also select the bands to be modified explicitly with a preceding RasterSelector, if necessary.
Hi @arsi, if you need to replace cell values of original Nodata for all bands with 0, the RasterBandNodataSetter with setting Yes to the Replace Cell Values parameter should work as well. You can also select the bands to be modified explicitly with a preceding RasterSelector, if necessary.
Oh, I have misunderstood the requirement. If the original Nodata definition was R=237 AND G=28 AND B=36, the workflow above won't help you. Follow @jdh's suggestion.
Thanks a lot! I added a rasterinterpretationcoercer to put the nodata to a new alpha band.
However, it seems that the compression when writing to ECW also generates footprints in the nodata in the alphaband (value becomes 1 or more). It seems that Geoserver has no option to declare the entire alpha band to be nodata regardless of value after compression (like QGIS has).
Is it possible to let the entire alpha band retain it's value 0 for nodata when writing to ECW? Or is there another way? Can for instance the entire geotiff be used as a clipper in a second FME-script or all values of the alphaband of the ECW be reset to 0 and are they then retained when writing to ECW again or are they again lost in compression?