Dendrogram (Spatial Analyst)

Available with Spatial Analyst license.

Summary

Constructs a tree diagram (dendrogram) showing attribute distances between sequentially merged classes in a signature file.

Learn more about how Dendrogram works

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.

Parameters

LabelExplanationData Type
Input signature file

Input signature file whose class signatures are used to produce a dendrogram.

A .gsg extension is required.

File
Output dendrogram file

The output dendrogram ASCII file.

The extension can be .txt or .asc.

File
Use variance in distance calculations
(Optional)

Specifies the manner in which the distances between classes in multidimensional attribute space are defined.

  • Checked—The distances between classes will be computed based on the variances and the Euclidean distance between the means of their signatures.
  • Unchecked—The distances between classes will be determined by the Euclidean distances between the means of the class signatures only.
Boolean
Line width of dendrogram
(Optional)

Sets the width of the dendrogram in number of characters on a line.

The default is 78.

Long

Dendrogram(in_signature_file, out_dendrogram_file, {distance_calculation}, {line_width})
NameExplanationData 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.

  • VARIANCE The distances between classes will be computed based on the variances and the Euclidean distance between the means of their signatures.
  • MEAN_ONLY The distances between classes will be determined by the Euclidean distances between the means of the class signatures only.
Boolean
line_width
(Optional)

Sets the width of the dendrogram in number of characters on a line.

The default is 78.

Long

Code sample

Dendrogram example 1 (Python window)

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", "")
Dendrogram example 2 (stand-alone script)

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

# 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 = ""

# Execute Dendrogram
Dendrogram(inSig, outDendro, "VARIANCE", lineLength)

Licensing information

  • Basic: Requires Spatial Analyst
  • Standard: Requires Spatial Analyst
  • Advanced: Requires Spatial Analyst

Related topics