I have a question regarding the Con statement when used in the SA Raster Calculator.

I am reclassifying a raster (categorical, integer) based on my own mappings but also on another raster (for some of the classes). So example I have


I've written it like that for ease of reading.

My issue arises when there's no value for aez.tif (i.e. aez.tif value is NoData or the raster does not extend to the pft.tif extent). From what I've seen the result is NoData. I thought it would result in "5". What I want is that if the Con with aez.tif results in this no value, that it does infact return some default that I've specified. I can't do that with e.g.


since that terminates the Con while I still have other conditionals to try.

1 Answer 1


One way out would be to extend the extents of aez.tif to match pft.tif and put some bogus value on the NoData (-9999 for instance).

Another option is to use the isNull function (or a not isNull) inside your Con statement so the null value is considered.

Another thing that might help is to check the processing extent of your raster calculator. By default it uses the intersection of inputs (ptf and aez) but I believe you can force it to consider the extent of one or another.

  • Great thanks. I went for your first suggestion by creating another raster with nodata=2. However your second suggestion seems more efficient (i.e. I don't have to create another raster).
    – tanksnr
    Dec 3, 2015 at 8:14
  • Glad to hear the answer was useful and it worked
    – Daniel
    Dec 4, 2015 at 10:43

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.