Skip to main content
Question

RasterExpressionEvaluator with multiple rasters unable to handle NoData pixels?

  • September 10, 2018
  • 1 reply
  • 17 views

wolters
Contributor
Forum|alt.badge.img+6

I have one raster with values of 1 and NoData (as defined in an earlier RasterExpressionEvaluator, with an expression such as follows: @if(A[0]>2999,1,0), and a second raster with values of 2 and NoData (defined earlier as follows: @if(A[0]>2999,2,0). In both rasters, NoData value is the same (0)

When I want to make a composite raster, by taking raster 1 where values are 1, and else values of raster 2, e.g. @if(A[0]==1,A[0],B[0]), pixels with NoData in raster 1 will remain NoData. The expected behavior is that all pixels that are false in the expression become values of raster 2.

Is this intentional behavior?

It can be avoided by using RasterBandNoDataRemover but it seems silly to me that RasterExpressionEvaluator does not take it into account while demanding that of all input rasters the nodata values are the same...

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.

1 reply

jdh
Contributor
Forum|alt.badge.img+37
  • Contributor
  • 2002 replies
  • September 10, 2018

The behaviour of the RasterExpressionEvaluator with NoDataValues and conditional statements is erratic.

 

 

See https://knowledge.safe.com/content/idea/62588/clarify-how-nodata-should-be-treated-in-rasterexpr.html for an idea to clarify it, as well as links to previous discussion on the subject.