Available with Spatial Analyst license.
Summary
Creates an ASCII signature file of classes defined by input sample data and a set of raster bands.
Usage
A .gsg extension should be used for the output signature file.
The input raster bands and the input raster or feature sample data must have overlapping extents. The statistics will be computed for the common area only.
The minimum valid number of class samples in the sample data is two. There is no maximum number of classes.
If the signature file is to be used in further multivariate analysis tools that use covariance matrices, such as Maximum Likelihood Classification and Class Probability, the covariance matrices must be present. This information is generated when the Compute covariance matrices option in the dialog box is enabled, or the COVARIANCE option is specified in scripting. Note that this is the default setting. See How Create Signatures works to compare signature files when the covariance matrices are generated versus only the means.
You should not change anything in the signature file except to enter the names of classes. The statistics in the file should be created and altered by Multivariate tools only.
The names of the classes in the output signature file are optional. They're used for reference only. The class names can be entered through the Sample field or any text editor can be used on the resulting signature file to input the names. Each class name must consist of a single string no more than 31 alphanumeric characters in length.
If the input is a layer created from a multiband raster with more than three bands, the operation will consider all the bands associated with the source dataset, not just the three bands that were loaded (symbolized) by the layer.
There are several ways you can specify a subset of bands from a multiband raster to use as input into the tool.
- If using the tool dialog box, browse to the multiband raster using the browse button next to Input raster bands, open the raster, and select the desired bands.
- If the multiband raster is a layer in the Table of Contents, you can use the Make Raster Layer tool to create a new multiband layer containing only the desired bands.
- You can also create a new dataset that contains only the desired bands with Composite Bands and use the resulting dataset as input to the tool.
- In Python, the desired bands can be directly specified in the tool parameter as a list.
See Analysis environments and Spatial Analyst for additional details on the geoprocessing environments that apply to this tool.
Syntax
CreateSignatures (in_raster_bands, in_sample_data, out_signature_file, {compute_covariance}, {sample_field})
Parameter | Explanation | Data Type |
in_raster_bands [in_raster_band,...] | The input raster bands for which to create the signatures. They can be integer or floating point type. | 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.
| Boolean |
sample_field (Optional) | Field of the input raster or feature sample data to assign values to the sampled locations (classes). Only integer or string fields are valid fields. The specified number or string will be used as the Class name in the output signature file. | 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
# 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
Licensing information
- ArcGIS Desktop Basic: Requires Spatial Analyst
- ArcGIS Desktop Standard: Requires Spatial Analyst
- ArcGIS Desktop Advanced: Requires Spatial Analyst