0

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?

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
  • Your word problem and conditional expression do not correlate. I would have expected raster2 in the first term. – Vince Jan 07 '20 at 12:44
  • See my comments to https://gis.stackexchange.com/questions/344569/arcgis-raster-calculator-erase-raster-from-raster?noredirect=1#comment562895_344569 – FelixIP Jan 07 '20 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 07 '20 at 23:02

1 Answers1

0

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'))
Will McInnes
  • 450
  • 3
  • 10