Create Signatures (Spatial Analyst)
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.
-
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. If you want to process a subset of the bands in the source dataset, you can use the Make Raster Layer tool to create an input layer containing the desired bands.
-
The names of the classes in the output signature file are optional. They're used for reference only. Any text editor can be used to enter the names. Each class name must consist of a single string no more than 14 alphanumeric characters in length.
Syntax
Parameter | Explanation | Data 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.
| 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
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 # 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)