Skip to main content
Solved

RasterExpressionEvaluator Expression to select raster GRAY8 values

  • July 24, 2025
  • 2 replies
  • 35 views

galigis
Enthusiast
Forum|alt.badge.img+20

Hi All,

I often encounter difficulties when attempting to select specific raster values using FME. I am currently working with a raster dataset that contains two bands, and I need to isolate the following values:

  • Band 0 (GRAY8) = 3
  • Band 0 (GRAY8) = 4

Could you please advise on the appropriate expression to use within the RasterExpressionEvaluator to achieve this selection?

Thanks :)

Best answer by takashi

Hi ​@galigis ,

I suppose @if function is what you want. For example, if you would like to keep only 3 or 4 and  set a specific value - e.g. 0 to other cells, this expression works for you.

@if(A[0]==3 || A[0]==4, A[0], 0)

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

takashi
Celebrity
  • Best Answer
  • July 24, 2025

Hi ​@galigis ,

I suppose @if function is what you want. For example, if you would like to keep only 3 or 4 and  set a specific value - e.g. 0 to other cells, this expression works for you.

@if(A[0]==3 || A[0]==4, A[0], 0)


galigis
Enthusiast
Forum|alt.badge.img+20
  • Author
  • Enthusiast
  • July 24, 2025

Spot on! :) thanks ​@takashi