So I am trying to join/merge two raster layers that have values of either 1 or 0. I am using the following command in in ArcGIS Raster Calculator:

Con(("urban" == 1) | ("mixed" == 1), 1, 0)

The new raster layer is missing cells from the "urban" raster layer, I have no idea why this is happening.

I have also tried the following commands with the same result:

("urban" == 1) | ("mixed" == 1)


removing all the cells equal to 0 in both layers and then:

"urban" + "mixed"
  • Did you try to use " & " instead of " | " for combining the conditions?
    – Matte
    Feb 27, 2017 at 12:29
  • 1
    I have tried that, a get a raster layer with cells only equal to 0. The cells that are equal to 1 in both layers are not overlapping, so there are no cases where both conditions are true, hence I am using "|"
    – Trashmonk
    Feb 27, 2017 at 12:47
  • 2
    Have you tried simply adding the two rasters "urban" + "mixed" without removing the 0 cells? You'll end up with 0+1, 1+0 or 0+0. The result will be grid with 1s and 0s since urban and mixed are mutually exclusive. Removing 0s may be causing you trouble.
    – user92055
    Feb 27, 2017 at 16:26

1 Answer 1


This will work for your case:

Out_Raster = SetNull((Abs(IsNull("urban")-1)+Abs(IsNull("mixed")-1))<1,(Abs(IsNull("urban")-1)+Abs(IsNull("mixed")-1)))

Here is a part by part explanation:

  • IsNull("urban") returns 0 for data values and 1 for nulls.
  • Abs(IsNull("urban")-1) will make nulls into 0 and other cells into 1 by subtracting 1 and taking absolute value.
  • (Abs(IsNull("urban")-1)+Abs(IsNull("mixed")-1)) Compiles all 1 values from both datasets.
  • I then feed this ugly expression (UGLY_EXP) into a SetNull(UGLY_EXP<1,UGLY_EXP) to set all the 0 values to null and other cells to 1.

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.