1

I am using ModelBuilder for ArcGIS Desktop 10.2

I have the following code in the Raster Calcualtor which works in some cases but not in others.

Int(Con(IsNull("%A%")|"%A%"== 0,"%B%",float(%Max%) + "%A%"))

In cases that A is Null I want the code to return the value from B however it is returning a Null. I suspect there is a flaw in the OR syntax but I can't work out what is wrong.

2
  • This question suggests that the error may be the % signs around your variables. Seems to be caused by ModelBuilder.gis.stackexchange.com/questions/82889/raster-calculator-error
    – David W
    Nov 26, 2015 at 15:49
  • The % are required by model builder to refer to temporary files. ArcGIS adds them when you click on the required rasters.
    – falcs
    Nov 26, 2015 at 15:52

1 Answer 1

2

The problem is in the OR expression. A nested Con() statement works

Int(Con(IsNull("%A%"), %B%, Con("%A%"==0, %B%, float(%Max%) + "%A%")))

Your OR expression seems to be evaluating to NoData and receiving NoData as output. See the help here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.