Skip to main content
Solved

RasterExpressionEvaluator Expression problem

  • July 17, 2018
  • 2 replies
  • 28 views

Forum|alt.badge.img

Hi

I have a raster with the following properties:

I want to use the RasterExpressionEvaluator to set new values to each cell. I have written this expression: @if(A[0]<0.07, 0, @if(A[0]<0.5, 1, @if(A[0]<1, 2, @if(A[0]<1.5,3, @if(A[0]<2,4,5))))) but I can't get it work.

Any suggestion?

Best answer by takashi

Hi @zampy, the RasterExpressionEvaluator may not work if the input raster has Nodata.

Try removing Nodata with the RasterBandNodataRemover beforehand. You can restore Nodate with the RasterBandNodataSetter afterward, if necessary.

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
  • 7843 replies
  • Best Answer
  • July 17, 2018

Hi @zampy, the RasterExpressionEvaluator may not work if the input raster has Nodata.

Try removing Nodata with the RasterBandNodataRemover beforehand. You can restore Nodate with the RasterBandNodataSetter afterward, if necessary.


Forum|alt.badge.img
  • Author
  • 3 replies
  • July 17, 2018

Hi @zampy, the RasterExpressionEvaluator may not work if the input raster has Nodata.

Try removing Nodata with the RasterBandNodataRemover beforehand. You can restore Nodate with the RasterBandNodataSetter afterward, if necessary.

Hi @takashi,

 

It works! Thanks