# Determining raster intersection using ArcGIS for Desktop?

Using Arc 10.2.2 with Spatial Analyst, I need to determine the spatial intersection of two rasters (both rasters are in the same coordinate system, and are aligned to the same snap raster). The two rasters have different values.

Specifically, I want to determine which cells are occupied by both raster A and raster B.

Here's my method, using the Raster Calculator:

1. I create an intermediate raster each for raster A and B, calculating the output to the value 1. This identifies, for each raster, which cells are occupied:

intermediate_A = (A * 0) + 1

intermediate_B = (B * 0) + 1

1. Add the two intermediate rasters together:

final_output = intermediate_A + intermediate_B

The final_output raster will have the value 2 for the intersecting cells, otherwise NoData.

Everything seems to work correctly. However, I'm wondering if there's a more efficient way to determine the spatial intersection with fewer steps or without creating the intermediate rasters?

• Con( ~IsNull("A" + "B"),1) – FelixIP Dec 9 '15 at 19:08

Try: `Con(((IsNull(A))|(IsNull(B))),0,1)`