Create Signatures (Spatial Analyst)

Summary

Creates an ASCII signature file of classes defined by input sample data and a set of raster bands.

Learn more about how Create Signatures works

Usage

Syntax

CreateSignatures (in_raster_bands, in_sample_data, out_signature_file, {compute_covariance}, {sample_field})
ParameterExplanationData Type
in_raster_bands
[in_raster_band,...]

The input raster bands for which to create the signatures.

Raster Layer
in_sample_data

The input delineating the set of class samples.

The input can be an integer raster or a feature dataset.

Raster Layer | Feature Layer
out_signature_file

The output signature file.

A .gsg extension must be specified.

File
compute_covariance
(Optional)

Specifies whether covariance matrices in addition to the means are calculated.

  • COVARIANCE Both the covariance matrices and the means for all classes of the in_sample_data will be computed. This is the default.
  • MEAN_ONLY Only the means for all classes of the in_sample_data will be calculated.
Boolean
sample_field
(Optional)

Field of the input raster or feature sample data to assign values to the sampled locations (classes).

Only integer fields are valid fields.

Field

Code Sample

CreateSignatures example 1 (Python window)

This example creates a signature file for classes defined by sampled training areas and a set of input raster bands.

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
CreateSignatures("sb", "sbtrain", "c:/sapyexamples/output/rbsig.gsg", 
                 "COVARIANCE", "")
CreateSignatures example 2 (stand-alone script)

This example creates a signature file for classes defined by sampled training areas and a set of input raster bands.

# Name: CreateSignatures_Ex_02.py
# Description: Creates an ASCII signature file of classes defined by input 
#    sample data and a set of raster bands.
# Requirements: Spatial Analyst Extension
# Author: ESRI

# 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 = "sb"
inSamples = "sbtrain"
outSig = "c:/sapyexamples/output/rbsig02.gsg"
sampField = ""

# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")

# Execute CreateSignatures
CreateSignatures(inRaster, inSamples, outSig, "COVARIANCE", sampField)

Environments

Related Topics

Licensing Information

ArcView: Requires Spatial Analyst
ArcEditor: Requires Spatial Analyst
ArcInfo: Requires Spatial Analyst

6/29/2011