0

I have two raster datasets called "Raster1" and "Raster2". Raster1 is slightly larger than Raster2 in extent (in Top, Left, Right and Bottom). This means Raster2 is fully contained by Raster1.

I would like to use Raster Calculator in ArcGIS Desktop 10.5.1 to build an expression to create a new raster that meets all of the following criteria:

  1. has the same extent of Raster1 (larger extent);
  2. where Raster2 exists, pixel values are from Raster2;
  3. where Raster2 does not exist but Raster1 exits, pixel values are NoData.

How can I go about specifying the expression in the Raster Calculator window to achieve this?

1 Answer 1

1

I think you should use set the extent of the output in the Environments of the Raster Calculator to match your larger raster (Raster 1).

enter image description here

enter image description here

(here, you should add your Raster2 extent, otherwise use other options like Union of inputs that might work as well)

Then do a Conditioal expression like (not tested):

Con("Raster2", "Raster2")

This should output a Raster with the same extent as Raster1 (as long as you set the Environments correctly), with pixels equals Raster2 in the areas of Raster2 and NoData in all other areas (assuming that a false condition is giving NoData as explained in the Con geoprocessing tool).

2
  • 1
    You shouldn't need the con statement at all, the statement just needs raster2. The output described is really just a copy of raster2 with the extent (perhaps snap also) set to raster1. Commented Sep 3, 2019 at 19:02
  • 1
    @RGfromRWBJV good point. I am not sure about the NoData though, but I think it might be the same. I would keep the Con in my answer as it is verbose (it's probably not needed like you said, but it makes the process clearer to me).
    – umbe1987
    Commented Sep 3, 2019 at 19:25

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.