So, I am trying to use the Con statement in ArcMap to add a certain value to a raster dataset (raster2) if the data is the same as an other dataset (raster1), if not I should just stay the same. I tried to use the expression:

Con(("raster1" == 1), ("raster2" + 1.5), "raster2")

But it seemed to null out any values that where not within raster 1, and therefore loses a lot of values and data.

Does anyone have a solution?

  • Your word problem and conditional expression do not correlate. I would have expected raster2 in the first term.
    – Vince
    Jan 7, 2020 at 12:44
  • See my comments to gis.stackexchange.com/questions/344569/…
    – FelixIP
    Jan 7, 2020 at 19:55
  • 1
    The issue here are different extents. So, set extent to r2. In calculator type r1. Use original expression, replacing r1 by r3. r3 is output of first calculation.
    – FelixIP
    Jan 7, 2020 at 23:02

1 Answer 1


If Con is your only operation - you could try using the standalone Con tool (see documentation).

You could try:

Con ('raster2', ('raster2'+'raster1'), 'raster2',('raster2'=='raster1'))
  • 1
    This is not an issue he is talking about. BTW his expression is correct.
    – FelixIP
    Jan 7, 2020 at 19:57
  • good point @FelixIP, I missed that this was in raster calculator, and now suggest the Con tool Jan 7, 2020 at 22:01

Your Answer

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

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