Skip To Content

Region Group function

Available with Spatial Analyst license.

Overview

Records, for each cell in the output, the identity of the connected region to which that cell belongs. A unique number is assigned to each region.

Notes

The first region scanned receives the value one, the second two, and so forth, until all regions are assigned a value. The scan moves from left to right, top to bottom. The values assigned to the output zones are based on when they are encountered in the scanning process.

By default, the Add Link option is enabled. This will create an item called LINK in the attribute table of the output raster, which retains the original value for each cell from the input raster. The LINK field allows you to trace the parentage of each of the newly created regions for queries or analysis.

It will significantly speed up the processing if the link field is not created. If the original value of each region is no longer needed, select the NO_LINK option instead of ADD_LINK.

Cell locations that contain the excluded value receive zero on the output so that these zones are not confused with existing NoData cell locations. Since the numbering begins with the value 1, the cells that are excluded from the regroup are considered background. These background cells can be reclassed or manipulated as any other value. The locations containing excluded values can easily be converted to NoData using the Con function.

Parameters

Parameter nameDescription

Zone Raster

(Required)

The input raster whose unique connected regions will be identified.

It must be of integer type.

Number of Neighbor Cells

The number of neighboring cells to use in evaluating connectivity between cells.

  • FOUR—Defines connectivity between cells of the same value only if the cells are directly to the left, right, above, or below each of the four nearest neighbors. This is the default.

  • EIGHT—Defines connectivity between cells of the same value if they are within the immediate eight-cell neighborhood of each other. This includes to the right, left, above, or diagonal to each other.

Zone Connectivity

Defines which cell values should be considered when testing for connectivity.

  • WITHIN—Tests connectivity between input values that are the same within the same zone. This is the default.

    The only cells that can be grouped are cells from the same zone (value) that meet the spatial requirements of connectivity specified by the Number of neighbours parameter (four-way or eight-way).

  • CROSS—Tests connectivity by the spatial requirements specified by the number of neighbors parameter between cells with any values, except for the value identified to be excluded by the excluded value parameter.

    When this option is used, a value for the Excluded value parameter must be specified.

Add Link

Specifies whether a link field is added to the table of the output.

  • ADD_LINK—An item LINK item will be added to the table of the output raster.

  • NO_LINK—The attribute table for the output raster will only contain the Value and Count items.

Excluded Value

Identifies a value such that if a cell location contains the value, no spatial connectivity will be evaluated regardless how the number of neighbors is specified (FOUR or EIGHT).

Cells with the excluded value will be treated as NoData and are eliminated from calculations. Cell locations that contain the excluded value will receive 0 on the output raster.

The excluded value is similar to the concept of a background value, or having a mask applied. A value must be specified for this parameter if the CROSS parameter is specified.

In this topic
  1. Overview
  2. Notes
  3. Parameters