5

I've a problem with the ArcGIS Raster Calculator:

I have two 2-Bit Rasters with the same extent, the only data stored in it are 1-values and NoData. Now I want to combine this two Rasters: If in layer one and/or two the value is 1, I want a 1 in my new raster. If the two layers are 0, it should be NoData.

I tried:

((Raster1 == 1) | (Raster2 == 1)) *1

Doesn't work, neither I don't know if this should be correct..

Con(((Raster1 == 1) | (Raster2 == 1)),1)

And the last one:

Con((Raster1 == 1), 1, Raster2)

All the time it returns me a new Raster which is only 1 if Raster1 AND Raster2 is 1. How should I do this? What's the mistake?

1 Answer 1

4

This has tripped me up a few times. You think you have access to all of Raster1 but the areas of NoData are instantly off limits to the rest of the operation. Try adding IsNull to the Con statement.

Con(IsNull("Raster1"), "Raster2", "Raster1")

I think that should work for you. Note that if both are NoData there will still be NoData and if that is not desired you will need to add more steps to make those areas into 0 values (similarly using IsNull should work well) if that is desired. Otherwise this should work for you if you prefer having the areas of NoData.

1
  • Yep, that was it. Important to know that that Raster Calculator is handling the NoData-cells this way. Thank you!
    – leFörster
    Jan 26, 2016 at 15:36

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.