Clipping rasters to a shapefile and merging into one image

In this Section:

Software version: ArcPro 2.9

Clipping a raster by itself is not difficult. However, sometimes we work with several images that cover larger area of interest (AOI), and would like to combine them into one image shaped based on the defined AOI.

First thing first – create a shapefile with the AOI as a polygon. Now for the tools:

Clipping single raster

If you have one image that needs to be clipped to a smaller area, the tools is <Extract by Mask>. The tool could be located under Spatial Analyst toolbox – Extraction – Extract by Mask.

The mask would be the polygon shape in the created shapefile.

There is another tool in the same toolbox called <Extract by Polygon>. However, this tool is running based on a list of x, y coordinates for each vertices in the polygon.  Below is the tool overview from ArcMap 10.8.1.

So, personally I prefer using mask as it will simplify the more complex process.

Merging multiple rasters into one

<Mosaic to New Raster> is the tool located under the Data Management Tools – Raster – Raster Dataset. Keep in mind the cell resolution of original images, number of bands, bit depth, and Coordinate systems of each original image.

Clipping multiple rasters to a custom shape

So, now that we know the tools that work, how do we clip several rasters? I did not find a batch option for clipping neither in ArcPro, not in ArcMap. So, my recommendation would be to build a model to run the clipping tool on all images, and add the merge tool as the final step. 

Here is an example of the model for 2 rasters that need to be extracted into one:

On the left are the original data – 2 images and a shapefile with custom AOI. Yellow squares are the tools. One in red is the running tool. Created outputs become inputs for the Mosaic dataset. Raster processing does take time, therefore with the model I don’t have to sit and wait to run clipping tool for each raster. I can just let the model run until it’s done.

Mode on how to work with Model Builder in ArcPro could be fined here – Use ModelBuilder—ArcGIS Pro | Documentation