Skip to main content
Question

RasterExpressionEvaluator with multiple rasters unable to handle NoData pixels?

  • September 10, 2018
  • 1 reply
  • 12 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...

1 reply

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • 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.

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings