Extracting Rasters with a Mask Layer

Included in this tutorial:

  • Utility of the Extract by Mask tool

  • Opening the tool and reviewing its options and parameters

  • Running the tool with an example and examining results

Software version in examples: ArcGIS Pro 3.0.0.

Tutorial Data: The tutorial includes demonstration with sample data available here.

Credits: Varisa Tanti (2022)

 

To limit the extent of your raster data, the Extract by Mask tool can be used to extract cells within your raster dataset based on the spatial extent of either another raster dataset or a polygon feature.

Related: This tool requires either the Spatial Analyst or 3D Analyst extension in ArcGIS Pro. To verify your software’s extensions, see Which Esri Extensions Is My Software Licensed to Use? 

 

Utility of the Extract by Mask Tool

When working with raster layers, you often need to limit your to your study area.

  • Graphically, this is helpful when geoprocessing outputs extend beyond the relevant area.

  • Analytically, this is crucial when the range of values needs to be limited to those within your study area or when you must ensure that your rasters’ cells are aligned for map algebra.

Extracting rasters with a vector layer mask will, in effect, “clip” the raster so that it does not include those irrelevant cells (or cell values) beyond the mask. 

While its most common use is as a raster-version of the “clip” tool. This tool can also be used to extract all the cells outside the mask, creating a “donut” raster.

In the example below, the area within the white vector boundaries serves as our “example study area.” The problem is that the current raster (called “EucDist_Points1” in the screenshot) extends beyond the full scope of the study area.

Example set up: before extracting a new raster with a vector mask

 

Opening the Extract by Mask Tool

You can access the Euclidean Distance tool by clicking the Geoprocessing toolbox in the main ribbon, and selecting Spatial Analysis Tools > Extraction > Extract by Mask. You can also search for “Extract by Mask” in the search bar.

The path to opening the Extract by Mask tool is Geoprocessing Tools > Spatial Analysis Tools > Extraction > Extract by Mask

 

Extract by Mask Tool Options & Parameters

In the Extract by Mask dialogue box, you will see these fields: input raster, input raster or feature mask data, output raster, extraction area, and analysis extent.

the inputs for running the Extract by Mask geoprocessing tool

Here’s a brief description of the different inputs:

  • Input raster: The input raster from which cells will be extracted. In our example, this is the “EucDist_Points1” raster layer.

  • Input raster or feature mask data: The input mask data defining the cell locations to extract. In other words, the boundaries for this layer are what the input raster will be clipped to. 

    • Notice that you can use either a raster or a vector layer as a mask. 

    • In our example, this data is the “Tracts” polygon feature layer, symbolized in the screenshots with white outlines.

  • Output raster: The location and name of the output raster.

  • Extraction area: Specifies whether cells inside or outside the locations define by the input mask will be extracted for the output raster. Notice here that choosing “outside” will create a “donut” raster.

  • Analysis extent: The geoprocessing extent that defines the area to be extracted. The default is the extent of the intersection of the input raster and input raster feature mask data.

 

Running the Tool & Examining Results

When you are ready to process the tool, click ‘Run.’

For our example, the newly created extracted raster is added to the map project, called “Extract_EucD1.” As expected, its values are restricted to cells within the boundaries of the Tracts layer polygons.

Note that the output raster is, indeed, rectangular. The cells beyond the study area have NoData values.

the results of running the Extract by Mask tool

 
Previous
Previous

Using the Raster Calculator for Map Algebra

Next
Next

Reclassifying Rasters