Label | Explanation | Data Type |
Input raster bands | The input raster bands for which to create the signatures. They can be integer or floating point type. | Raster Layer |
Input raster or feature 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 |
Output signature file | The output signature file. A .gsg extension must be specified. | File |
Compute covariance matrices (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 |
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
When a multiband raster is specified as one of the Input raster bands (in_raster_bands in Python), all the bands will be used.
To process a selection of bands from a multiband raster, you can first create a new raster dataset composed of those particular bands with the Composite Bands tool, and use the result in the list of the Input raster bands (in_raster_bands in Python).
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.
See Analysis environments and Spatial Analyst for additional details on the geoprocessing environments that apply to this tool.
Parameters
CreateSignatures(in_raster_bands, in_sample_data, out_signature_file, {compute_covariance}, {sample_field})
Name | 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
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", "")
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 = ""
# Execute CreateSignatures
CreateSignatures(inRaster, inSamples, outSig, "COVARIANCE", sampField)
Environments
Licensing information
- Basic: Requires Spatial Analyst
- Standard: Requires Spatial Analyst
- Advanced: Requires Spatial Analyst