Description
This is a raster tool that identifies contiguous blocks of cells of the same value (i.e. regions) and assigns each region a unique ID number that is written to the output raster dataset. It is designed for use only with thematic (categorical) rasters.
The cell neighbourhood that is evaluated can be all eight cells that surround a cell (this is the default option), or can be limited to only the four cardinal cells using the 'diag=FALSE' option, which prevents diagonal connections being evaluated when defining region membership.
The unique ID numbers in the output raster are arbitrary, but are ordered by when the region is first encountered when moving left to right and top to bottom through the raster dataset. The output also includes a DBASE (dbf) table that summarises the number of cells that belong to each region.
For large raster datasets this tool can take quite some time to run (a few hours for very large rasters). It is therefore recommended that you test the tool on a small raster dataset before applying it to the full dataset.
Syntax
regiongroup(in, out, [diag]);
| in | the input integer raster data source | |
| out | the output integer raster data source | |
| [diag] | (TRUE/FALSE) allow cells to be diagonally connected when defining regions? (default=TRUE) |
Example
regiongroup(in="C:\data\landcov", out="C:\data\lcovrg");
regiongroup(in="C:\data\landcov", out="C:\data\lcovrg", diag=FALSE);