How To: Clip or extract the area of a raster image using polygon features
In some cases, users want to clip out the portions of a raster that fall inside a dataset containing polygon features, and keep only the areas around the polygons.
The instructions provided describe how to clip or extract a raster outside polygon boundaries.
Use the Extract by Polygon tool
Note: The Extract by Polygon tool requires a Spatial Analyst license.
The Extract by Polygon tool has an extraction area parameter with an outside option which allows cells outside the input polygon to be selected and written to the output raster. All cells inside the polygon receive NoData values on the output raster. However, this tool does not allow the use of an existing polygon feature class for the input polygon. This tool requires the vertices to be entered manually, and is therefore not suitable for erasing more complex geometries.
For more information on the Extract by Polygon tool, refer to the following ArcGIS Web Help page: Extract by Polygon.
Use the Image Analysis window to apply a Clip function to the raster
- In ArcMap, click the Windows menu, and open the Image Analysis window.
- With the correct raster selected in the top portion of the Image Analysis window, click the Add Function button in the Processing section.
- Right-click Identity Function > Insert Function > Clip Function. This opens the Raster Function Properties window.
- Change Type to Inside.
- In the Clip section, under Clipping Geometry/Raster, browse to the desired polygon features, and check the Use Input Features for Clipping Geometry check box.
- Click OK > OK.
- Export the raster to save it permanently.
Use the Erase and Extract by Mask tools
Note: The Erase tool requires an ArcGIS Desktop Advanced license and the Extract by Mask tool requires a Spatial Analyst license.
- After a polygon feature is created on a raster, create a new feature class of a rectangular polygon that covers the entire extent of the raster.
- Use the Erase tool to erase the polygon features from the rectangular polygon.
- Use the output from Step 2 as the Input raster or feature mask data parameter in the Extract by Mask tool.
Note: In some cases, the extracted raster does not display properly because of the Stretch function applied to the raster. If this occurs, open the Layer Properties dialog box of the extracted raster > Symbology tab. In the RGB Composite renderer, change the Statistics drop-down list to From The Current Display Extent.