1

I have an 8 bit raster from which I want to create a new raster which just contains the cells containing the values 20 and 24 of the original raster.

I have SAFE FME 2015 but am unsure which transformer to use.

1

This can be easily done with the RasterExpressionEvaluator followed by RasterBandNoDataSetter.

  • First use a RasterExpressionEvaluator.
  • Set its interpretation to what you want (Int8 or UInt8)
  • Use an expression like this: @if(A[0] == 20 || A[0] == 24,A[0],255)
  • Now following that, place a RasterBandNoDataSetter and set the NoData value to 255.

What the expression does is that for any cell that is 20 or 24, it won't touch them. For all other cells it will set the value to 255 which we then tell FME is NoData. Any half-decent raster format and GIS will then ignore those values.

The A[0] is referring to the value of the cell (in band 1). If you had multiple bands and wanted to compare them, you'd use A[1] for band 2 for instance.

As a bonus, it's also remarkably quick to process.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.