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.
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
This can be easily done with the RasterExpressionEvaluator followed by RasterBandNoDataSetter.
@if(A == 20 || A == 24,A,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 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 for band 2 for instance.
As a bonus, it's also remarkably quick to process.