1

I have two rasters with the same extent, projected coordinate system, cell size and they are aligned.

"raster1" has continuous values ranging from 0 to 6.09 "raster2" has continuous values from 0 to 91.25

What I need to do is creating a new raster in which, cells that have "value=0", based on "raster1", they will remain 0 but in any other case, cells will be assigned a value based on the sum of the values from "raster1" & "raster2".

The expression I use in Raster Calculator is :

Con(("raster1" == 0), 0, (Con(("raster1" > 0) & ("raster2"  >= 0)), ...?

Obviously, this is not complete. What should I change?

0

This should do the trick:

Con("raster1" == 0,0, ("raster1" + "raster2"))
| improve this answer | |
  • 1
    Amend )) to ), 0.0) to account for first condition. – FelixIP Oct 1 '19 at 21:00
  • Seems to work fine the way it is. – Pdavis327 Oct 1 '19 at 21:27
  • Oops, missed 0,0 – FelixIP Oct 1 '19 at 22:14
  • Thank you so much! – YioKe Oct 2 '19 at 11:16
  • You're welcome. Please accept the answer If this worked for you (check mark). – Pdavis327 Oct 2 '19 at 13:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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