Summary
Performs unsupervised classification of a series of input raster bands using the Iso Clustering tool and the max-Likelihood classification tool.
Usage
· This tool combines the functionality of the ISO Clustering tool with the maximum likelihood classification tool. Outputs a classified raster. As an option, it can also output feature files.
· The feature file generated by this tool can be used as input to other classification tools, such as the maximum likelihood classification, to better control the classification parameters.
· The minimum valid value for the number of classes is two. There is no maximum number of clusters. Typically, the more clustering you have, the more iterations you need.
· To provide sufficient statistical data to generate a feature file for future categorization, each cluster should contain enough cells to accurately represent the cluster. The value entered for the minimum class size should be approximately 10 times times larger than the number of layers in the input raster band.
· The value entered for the sampling interval indicates that a cell is used in the cluster calculation for every n multiply n blocks of cells.
· You should not merge or remove classes, nor should you change any of the statistics for an ASCII signature file.
· Typically, the more cells that are included in the intersection range of the input bands, the greater the value specified for the minimum class size and sampling interval. The value entered for the sampling interval should be small enough to reasonably sample the smallest ideal category that exists in the input data.
· The class ID value in the output signature file starts with a start and then increases sequentially to the number of input classes. You can allocate any number of classes.
· The name of the output signature file must have a. gsg extension.
· If all the input bands have the same data range, the results will be more desirable. If the data range of the bands varies widely, you can use map algebra to perform the following equations to convert the various data ranges to the same range.
· 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.
· If you enter a layer created from a multiband raster (more than three bands), the operation takes into account all the bands associated with the source dataset, not just the three bands loaded (symbolized) by the layer.
· You can specify a subset of bands for a multiband raster as input to the tool in several ways.
· If you want to use the tool dialog box, navigate to the multi-band raster by the button next to the input raster bands, open the grid, and select the desired band.
· If the multiband raster is a layer in the table of contents, you can use the Create Raster Layer tool to create a new multiband layer that contains only the desired bands.
· You can also use band compositing to create a new dataset that contains only the desired bands and use the resulting dataset as input to the tool.
· In Python, you can specify the desired bands directly in the tool parameters as a list.
Grammar
Isoclusterunsupervisedclassification (Input_raster_bands, number_of_classes, {minimum_class_size}, {Sample_ Interval}, {output_signature_file})
Code instance
ISO Cluster unsupervised classification (Isoclusterunsupervisedclassification) Example 1 (Python window)
This example performs an unsupervised classification that divides 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")
ISO Cluster unsupervised classification (Isoclusterunsupervisedclassification) Example 2 (stand-alone script)
This example performs an unsupervised classification that divides 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
# Check out the ArcGIS Spatial Analyst extension License
arcpy. Checkoutextension ("Spatial")
# Execute Isocluster
outunsupervised = Isoclusterunsupervisedclassification (Inraster, classes, Minmembers, Sampinterval)
Outunsupervised.save ("C:/temp/outunsup01.tif")
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
ArcGIS Tutorial: Iso cluster unsupervised classification