Extract by Rectangle (Spatial Analyst)

This ArcGIS 2.8 documentation has been archived and is no longer updated. Content and links may be outdated. See the latest documentation.

Available with Spatial Analyst license.

Summary

Extracts the cells of a raster based on a rectangle by specifying the rectangle's extent.

Illustration

Extract by Rectangle illustration
OutRas = ExtractByRectangle(InRas1, Extent(1, 0, 5, 5), "INSIDE")

Usage

  • Additional attributes from the input raster, if any, will be carried over as-is to the output raster attribute table. Depending on the property being recorded, some of the attribute values may need to be recalculated.

  • When a multiband raster is specified as the Input Raster (in_raster in Python), all bands will be used.

    To process a selection of bands from a multiband raster, first create a new raster dataset composed of those particular bands using the Composite Bands tool. Then use the result as the Input Raster (in_raster in Python).

    The default output format is a geodatabase raster. If an Esri Grid stack is specified as the output format, the name of the stack cannot start with a number, use spaces, or be more than nine characters in length.

  • The center of the cell is used to determine whether a cell is inside or outside a rectangle. If the center is within the outline of a rectangle, the cell is considered fully inside even if portions of the cell fall outside the rectangle.

  • Cell locations that are not selected are assigned a value of NoData.

  • If the input raster is integer, the output raster will be integer. If the input is floating point, the output will be floating point.

  • See Analysis environments and Spatial Analyst for additional details on the geoprocessing environments that apply to this tool.

Parameters

LabelExplanationData Type
Input raster

The input raster from which cells will be extracted.

Raster Layer
Extent

A rectangle that defines the area to be extracted.

If the Extent parameter is set to As Specified Below, use the parameters identified with the left and down arrows define the lower-left coordinate of the area to be extracted, and those with the right and up arrows to define the upper-right coordinate.

If the Extent parameter is set to Browse, you can select a dataset whose bounding box will define the extent.

The coordinates are specified in the same map units as the input raster.

Extent
Extraction area
(Optional)

Identifies whether to extract cells inside or outside the input rectangle.

  • Inside — A keyword specifying that the cells inside the input rectangle should be selected and written to the output raster. All cells outside the rectangle will receive NoData values on the output raster.
  • Outside — A keyword specifying that the cells outside the input rectangle should be selected and written to the output raster. All cells inside the rectangle will receive NoData values on the output raster.
String

Return Value

LabelExplanationData Type
Output raster

The output raster containing the cell values extracted from the input raster.

Raster

Licensing information

  • Basic: Requires Spatial Analyst
  • Standard: Requires Spatial Analyst
  • Advanced: Requires Spatial Analyst

Related topics