Dendrogram (Spatial Analyst)
Summary
Constructs a tree diagram (dendrogram) showing attribute distances between sequentially merged classes in a signature file.
Usage
-
The input signature file must in the prescribed signature file format. A signature file can be created with the Iso Cluster or Create Signatures tools. The file must have a minimum of two classes. A signature file can be recognized by its .gsg extension.
-
The output of Dendrogram is an ASCII text file. The file has two components: a table and a graph.
The first component is a table of distances between pairs of classes, presented in the sequence for merging. The second component is a graphical representation using ASCII characters of the classes that demonstrates the relationships and the hierarchy of the merging. The graph illustrates relative distances between pairs of merged classes in the signature file, which are based on statistically determined similarities. The classes themselves represent clusters of cells or cells from training samples extracted from the study site.
By analyzing the graph and the associate table, you can determine the potential of merging classes.
-
The default extension for the output text file is .txt. It can also be .asc.
-
The proximity of a pair of classes within a signature file is measured by the attribute distance.
-
The value entered for the line width specifies the width of the graph based on the number of characters. The default value of 78 is also the minimum valid number of characters. If numbers less than this are entered, the default value of 78 will be applied. When specifying values higher than the default, the resolution of the graph will increase, which may provide more accurate interpolation of the distances.
-
To make the display of the dendrogram meaningful, the ASCII file should be displayed with a nonproportional font such as Courier.
Syntax
Parameter | Explanation | Data Type |
in_signature_file |
Input signature file whose class signatures are used to produce a dendrogram. A .gsg extension is required. | File |
out_dendrogram_file |
The output dendrogram ASCII file. The extension can be .txt or .asc. | File |
distance_calculation (Optional) |
Specifies the manner in which the distances between classes in multidimensional attribute space are defined.
| Boolean |
line_width (Optional) |
Sets the width of the dendrogram in number of characters on a line. The default is 78. | Long |
Code Sample
This example takes an input signature file and creates a Dendrogram view.
import arcpy from arcpy.sa import * Dendrogram("c:/sapyexamples/data/zsamp12.gsg", "c:/sapyexamples/output/z12dendro.txt", "VARIANCE", "")
This example takes an input signature file and creates a Dendrogram view.
# Name: Dendrogram_Ex_02.py # Description: Constructs a tree diagram showing attribute distances between # sequentially merged classes in a signature file. # Requirements: Spatial Analyst Extension # Author: ESRI # Import system modules import arcpy from arcpy.sa import * # Set local variables inSig = "c:/sapyexamples/data/zsamp12.gsg" outDendro = "c:/sapyexamples/output/z12dend.txt" lineLength = "" # Check out the ArcGIS Spatial Analyst extension license arcpy.CheckOutExtension("Spatial") # Execute Dendrogram Dendrogram(inSig, outDendro, "VARIANCE", lineLength)