Iso Cluster Unsupervised Classification (Spatial Analyst)

Available with Spatial Analyst license.

Summary

Performs unsupervised classification on a series of input raster bands using the Iso Cluster and Maximum Likelihood Classification tools.

Usage

  • This tool combines the functionalities of the Iso Cluster and Maximum Likelihood Classification tools. It outputs a classified raster. It optionally outputs a signature file.

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

    To process a selection of bands from a multiband raster, you can first create a new raster dataset composed of those particular bands with the Composite Bands tool, and use the result in the list of the Input raster bands (in_raster_bands in Python).

  • The resulting signature file from this tool can be used as the input for another classification tool, such as Maximum Likelihood Classification, for greater control over the classification parameters.

  • The minimum valid value for the number of classes is two. There is no maximum number of clusters. In general, more clusters require more iterations.

  • To provide the sufficient statistics necessary to generate a signature file for a future classification, each cluster should contain enough cells to accurately represent the cluster. The value entered for the minimum class size should be approximately 10 times larger than the number of layers in the input raster bands.

  • The value entered for the sample interval indicates one cell out of every n-by-n block of cells is used in the cluster calculations.

  • You shouldn't merge or remove classes or change any of the statistics of the ASCII signature file.

  • Generally, the more cells contained in the extent of the intersection of the input bands, the larger the values for minimum class size and sample interval should be specified. Values entered for the sample interval should be small enough that the smallest desirable categories existing in the input data will be appropriately sampled.

  • The class ID values on the output signature file start at one and sequentially increase to the number of input classes. The assignment of the class numbers is arbitrary.

  • The output signature file's name must have a .gsg extension.

  • Better results will be obtained if all input bands have the same data ranges. If the bands have vastly different data ranges, the data ranges can be transformed to the same range using Map Algebra to perform the equation.

    Iso Cluster equation
     where:
       Z is the output raster with new data ranges.
       X is the input raster.
       oldmin is the minimum value of the input raster.
       oldmax is the maximum value of the input raster.
       newmin is the desired minimum value for the output raster.
       newmax is the desired maximum value for the output raster.
  • See Analysis environments and Spatial Analyst for additional details on the geoprocessing environments that apply to this tool.

Parameters

LabelExplanationData Type
Input raster bands

The input raster bands.

They can be integer or floating point type.

Raster Layer; Mosaic Layer
Number of classes

Number of classes into which to group the cells.

Long
Minimum class size
(Optional)

Minimum number of cells in a valid class.

The default is 20.

Long
Sample interval
(Optional)

The interval to be used for sampling.

The default is 10.

Long
Output signature file
(Optional)

The output signature file.

A .gsg extension must be specified.

File

Return Value

LabelExplanationData Type
Output classified raster

The output classified raster.

Raster

IsoClusterUnsupervisedClassification(Input_raster_bands, Number_of_classes, {Minimum_class_size}, {Sample_interval}, {Output_signature_file})
NameExplanationData Type
Input_raster_bands
[in_raster_band,...]

The input raster bands.

They can be integer or floating point type.

Raster Layer; Mosaic Layer
Number_of_classes
number_of_classes

Number of classes into which to group the cells.

Long
Minimum_class_size
minimum_class_size
(Optional)

Minimum number of cells in a valid class.

The default is 20.

Long
Sample_interval
sample_interval
(Optional)

The interval to be used for sampling.

The default is 10.

Long
Output_signature_file
out_signature_file
(Optional)

The output signature file.

A .gsg extension must be specified.

File

Return Value

NameExplanationData Type
Output_classified_raster

The output classified raster.

Raster

Code sample

IsoClusterUnsupervisedClassification example 1 (Python window)

This example performs an unsupervised classification classifying the input bands into 5 classes and outputs a classified raster.

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
outUnsupervised = IsoClusterUnsupervisedClassification("redlands", 5, 20, 50)
outUnsupervised.save("c:/temp/unsup01")
IsoClusterUnsupervisedClassification example 2 (stand-alone script)

This example performs an unsupervised classification classifying the input bands into 5 classes and outputs a classified raster.

# Name: IsoClusterUnsupervisedClassification_Ex_02.py
# Description: Uses an isodata clustering algorithm to determine the 
#    characteristics of the natural groupings of cells in multidimensional 
#    attribute space and stores the results in an output ASCII signature file.
# Requirements: Spatial Analyst Extension

# Import system modules
import arcpy
from arcpy import env
from arcpy.sa import *

# Set environment settings
env.workspace = "C:/sapyexamples/data"

# Set local variables
inRaster = "redlands"
classes = 5
minMembers = 50
sampInterval = 15

# Execute IsoCluster
outUnsupervised = IsoClusterUnsupervisedClassification(inRaster, classes, minMembers, sampInterval)
outUnsupervised.save("c:/temp/outunsup01.tif")

Related topics