I have 3 Band RGB ECW Raster files and would like to change all the RGB values within the masked area to 0,0,0.

I am using the SpatialFilter to set the masking area and thought that I could use the RasterExpressionEvaluator(REV) to manipulate the rgb values. However I cannot find an expression which works.

I am using FME 2014 and setting the SpatialFilter to Mask = Filter, ECW File as Candidate with the Filter being "Intersects"and if does not pass, then the REV should work its magic. For each band in the REV (red8,green8,blue8) I set the the expression to

if ((A[0]+A[1]+A[2])>0, 0, A[0])

changing the last parameter for each band ...ie A1, A[2]...but this changes the whole image to 0,0,0. This doesn´t seem to be working.

  • Could it be a problem with my mask. My mask is a polygon shapefile containing a rectangle with a hole in it. Can I use a polygon with a hole as a mask to tell fme to only use the area filled and not the hole...or does fme fill in the hole when applying the spatial filter? – Robert Buckley Feb 25 '14 at 20:53
  • If you are pointing to the hole, try removing the hole with DonutHoleExtractor first. – Jorge Vidinha Feb 27 '14 at 15:52
  • Is your polygon in the same coordinate system as your raster? FME doesn't reproject on the fly like other GIS programs. You may need to add a reprojector first. Otherwise, your polygon might not overlap the raster and therefore not behave as a mask. – Fezter Mar 31 '14 at 23:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.