RasterExpressionEvaluator / RGB Band Expression Query
Hi All,
I’m having some issues to filter raster pixels by the band expression using the RasterExpressionEvaluator tranformer,
What the expression to select the pixels with the following band combination B(0)=64; B(1)=128;B(2)=104?
I have used the following settings but hasn’t worked:
Any ideas please? :)
Page 1 / 1
Any ideas on this please? I have been playing around but can’t get it to work...thanks! :)
It depends a little on what you mean by “select the pixels”.
If you want to extract or keep just those pixels then you can try something like this
@if(A0]!=64&&A&1]!=128&&A&2]!=104,0,A00])
You will need to use the expression once for each band like this:
This will set all pixels to 0,0,0 except pixels with an RGB value of 64,128,104.
If, however, you want the pixels instead as a polygon you can use the RasterToPolygon coercer - this will give you the vector representation and the band vales which you can later use to test on.
Thanks @virtualcitymatt - it has worked perfectly :)