Skip to main content

I want to redefine raster band values, based on another raster band value.

More specific: If raster band 3 has a value "0", raster bands 0, 1 and 2 should have a value "nodata".

How can this be done most efficiently?

Hi Bert,

I have already encountered something similar and fix it with a RasterExpressionEvaluator. I don't remember exactly how I did. You may try:

Red8 --> if(A[3]>0,A[0],-999)

Green8 --> if(A[3]>0,A[1],-999)

Blue8 --> if(A[3]>0,A[2],-999)

After this, add a RasterBandNodataSetter transformer with a Nodata Value = -999

I don't know if it is the most efficient way (and if it works 🙂 )


Hi Bert,

I have already encountered something similar and fix it with a RasterExpressionEvaluator. I don't remember exactly how I did. You may try:

Red8 --> if(A[3]>0,A[0],-999)

Green8 --> if(A[3]>0,A[1],-999)

Blue8 --> if(A[3]>0,A[2],-999)

After this, add a RasterBandNodataSetter transformer with a Nodata Value = -999

I don't know if it is the most efficient way (and if it works 🙂 )

Works with the RasterExpressionEvaluator and RasterBandNodataSetter, thanks!

 


Reply