com.esri.arcgis.geoprocessing.tools.spatialanalysttools
Class RegionGroup
java.lang.Object
com.esri.arcgis.geoprocessing.AbstractGPTool
com.esri.arcgis.geoprocessing.tools.spatialanalysttools.RegionGroup
- All Implemented Interfaces:
- GPTool
public class RegionGroup
- extends AbstractGPTool
For each cell in the output, the identity of the connected region to which that cell belongs is recorded. A unique number is assigned to each region.
The Region Group tool is contained in the Spatial Analyst Tools tool box.
Usage tips:
- 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 True. 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.
- Setting the Add Link option to False will significantly speed up processing. This is helpful when the original value of each region is no longer needed.
- If a has been set in the evironment, those cells that have been masked will receive NoData on the output raster. With a mask, the spatial configuration and the number of regions may be altered on the output raster. If a region was continuous and the imposition of a mask breaks the continuity, the region will be divided into two regions with different values or grouping identifiers on the output raster.The mask cannot only create additional regions by dividing a region into two or more separate regions, it can also reduce the number of regions on the output. If a mask totally covers or eliminates a potential region of connected cells, these cells will not be considered as a new zone on the output; they will receive NoData values.
- Region Group is especially useful when the analysis is on regions and not on zones. Since the input zone value is maintained, the original zonal class can also be used in the analysis.
- 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 Region Group begins numbering 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 tool.
Constructor Summary |
RegionGroup()
Creates the Region Group tool with defaults. |
RegionGroup(java.lang.Object inRaster,
java.lang.Object outRaster)
Creates the Region Group tool with the required parameters. |
Method Summary |
java.lang.String |
getAddLink()
Returns the Add link field to output parameter of this tool . |
int |
getExcludedValue()
Returns the Excluded value parameter of this tool . |
java.lang.Object |
getInRaster()
Returns the Input raster parameter of this tool . |
java.lang.String |
getNumberNeighbors()
Returns the Number of neighbors to use parameter of this tool . |
java.lang.Object |
getOutRaster()
Returns the Output raster parameter of this tool . |
java.lang.String |
getToolboxAlias()
Returns the alias of the tool box containing this tool. |
java.lang.String |
getToolboxName()
Returns the name of the tool box containing this tool. |
java.lang.String |
getToolName()
Returns the name of this tool. |
java.lang.String |
getZoneConnectivity()
Returns the Zone grouping method parameter of this tool . |
void |
setAddLink(java.lang.String addLink)
Sets the Add link field to output parameter of this tool . |
void |
setExcludedValue(int excludedValue)
Sets the Excluded value parameter of this tool . |
void |
setInRaster(java.lang.Object inRaster)
Sets the Input raster parameter of this tool . |
void |
setNumberNeighbors(java.lang.String numberNeighbors)
Sets the Number of neighbors to use parameter of this tool . |
void |
setOutRaster(java.lang.Object outRaster)
Sets the Output raster parameter of this tool . |
void |
setZoneConnectivity(java.lang.String zoneConnectivity)
Sets the Zone grouping method parameter of this tool . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
RegionGroup
public RegionGroup()
- Creates the Region Group tool with defaults.
Initializes the array of tool parameters with the default values specified when the tool was created.
RegionGroup
public RegionGroup(java.lang.Object inRaster,
java.lang.Object outRaster)
- Creates the Region Group tool with the required parameters.
Initializes the array of tool parameters with the values as specified for the required parameters and with the default values for the other parameters.
- Parameters:
inRaster
- the input raster whose unique connected regions will be identified. it must be of integer type.outRaster
- the output region group raster. the output raster is always of integer type.
getInRaster
public java.lang.Object getInRaster()
- Returns the Input raster parameter of this tool .
This parameter is the input raster whose unique connected regions will be identified. it must be of integer type.
This is a required parameter.
- Returns:
- the Input raster
setInRaster
public void setInRaster(java.lang.Object inRaster)
- Sets the Input raster parameter of this tool .
This parameter is the input raster whose unique connected regions will be identified. it must be of integer type.
This is a required parameter.
- Parameters:
inRaster
- the input raster whose unique connected regions will be identified. it must be of integer type.
getOutRaster
public java.lang.Object getOutRaster()
- Returns the Output raster parameter of this tool .
This parameter is the output region group raster. the output raster is always of integer type.
This is a required parameter.
- Returns:
- the Output raster
setOutRaster
public void setOutRaster(java.lang.Object outRaster)
- Sets the Output raster parameter of this tool .
This parameter is the output region group raster. the output raster is always of integer type.
This is a required parameter.
- Parameters:
outRaster
- the output region group raster. the output raster is always of integer type.
getNumberNeighbors
public java.lang.String getNumberNeighbors()
- Returns the Number of neighbors to use parameter of this tool .
This parameter is the number of neighboring cells to use in evaluating connectivity between cells.
This is an optional parameter.
- Returns:
- the Number of neighbors to use
setNumberNeighbors
public void setNumberNeighbors(java.lang.String numberNeighbors)
- Sets the Number of neighbors to use parameter of this tool .
This parameter is the number of neighboring cells to use in evaluating connectivity between cells.
This is an optional parameter.
- Parameters:
numberNeighbors
- the number of neighboring cells to use in evaluating connectivity between cells.
getZoneConnectivity
public java.lang.String getZoneConnectivity()
- Returns the Zone grouping method parameter of this tool .
This parameter is defines which cell values should be considered when testing for connectivity.
This is an optional parameter.
- Returns:
- the Zone grouping method
setZoneConnectivity
public void setZoneConnectivity(java.lang.String zoneConnectivity)
- Sets the Zone grouping method parameter of this tool .
This parameter is defines which cell values should be considered when testing for connectivity.
This is an optional parameter.
- Parameters:
zoneConnectivity
- defines which cell values should be considered when testing for connectivity.
getAddLink
public java.lang.String getAddLink()
- Returns the Add link field to output parameter of this tool .
This parameter is specifies whether a link field is added to the table of the output.
This is an optional parameter.
- Returns:
- the Add link field to output
setAddLink
public void setAddLink(java.lang.String addLink)
- Sets the Add link field to output parameter of this tool .
This parameter is specifies whether a link field is added to the table of the output.
This is an optional parameter.
- Parameters:
addLink
- specifies whether a link field is added to the table of the output.
getExcludedValue
public int getExcludedValue()
- Returns the Excluded value parameter of this tool .
This parameter is 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 setting a mask in the environment for a single run of the tool. A value must be specified for this parameter if the CROSS keyword is specified.
This is an optional parameter.
- Returns:
- the Excluded value
setExcludedValue
public void setExcludedValue(int excludedValue)
- Sets the Excluded value parameter of this tool .
This parameter is 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 setting a mask in the environment for a single run of the tool. A value must be specified for this parameter if the CROSS keyword is specified.
This is an optional parameter.
- Parameters:
excludedValue
- 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 setting a mask in the environment for a single run of the tool. A value must be specified for this parameter if the CROSS keyword is specified.
getToolName
public java.lang.String getToolName()
- Returns the name of this tool.
- Returns:
- the tool name
getToolboxName
public java.lang.String getToolboxName()
- Returns the name of the tool box containing this tool.
- Returns:
- the tool box name
getToolboxAlias
public java.lang.String getToolboxAlias()
- Returns the alias of the tool box containing this tool.
- Returns:
- the tool box alias