Edit Signatures (Spatial Analyst)

Available with Spatial Analyst license.

Summary

Edits and updates a signature file by merging, renumbering, and deleting class signatures.

Learn more about how Edit Signatures works

Usage

  • The Edit Signatures tool allows the modification of an existing signature file by all or any of the following operations:

    • Merging signatures of a set of classes
    • Renumbering a signature class ID
    • Deleting unwanted signatures
  • 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).

  • The input signature file must be an ASCII signature file. The file can be the output of any Multivariate tool that produces the file containing the required statistical information—for example, Iso Cluster and Create Signatures. The file must have a minimum of two classes. Such a file can be recognized by its .gsg extension.

  • The input signature remap file is an ASCII file consisting of two columns of values per line, separated by a colon. The first column is the value of the original class ID. The second column contains the new class IDs for updating in the signature file. All of the entries in the file must be sorted in ascending order based on the first column

    In certain cases, some of your desired classes may be statistically too similar to each other, therefore, assignment of cells to the unique classes may not be reliable. For example, you may have wanted a wetland class and a separate class for forest wetland. However, these two classes cannot be easily distinguished from one another. In this case, you may want to merge the forest wetland class into the more general wetland class. Alternatively, if there is no statistical difference between the classes, you can remove one of them altogether since they both essentially represent the same class.

    To merge a set of classes, put the same new class ID for the second value for each class ID of that set. Only classes that need to be edited have to be placed in the signature remap file; any class not present in the remap file will remain unchanged. To delete a class signature, use -9999 as the value for the second column of that class. A class ID can also be renumbered to a value that does not exist in the input signature file.

    The following is an example of an input signature remap file:

    2 : 3
    4 : 11
    5 : -9999
    9 : 3

    This example will merge classes 2 and 9 with 3, merge class 4 with 11, and delete class 5.

  • If the input signature file carries names for the class signatures and if the signatures in the input signature remap file are to be merged, the name associated with the value in which to merge will be transferred to the output signature file.

  • See Analysis environments and Spatial Analyst for additional details on the geoprocessing environments that apply to this tool.

Parameters

LabelExplanationData Type
Input raster bands

The input raster bands for which to edit the signatures.

They can be integer or floating point type.

Raster Layer
Input signature file

Input signature file whose class signatures are to be edited.

A .gsg extension is required.

File
Input signature remap file

Input ASCII remap table containing the class IDs to be merged, renumbered, or deleted.

The extension can be .rmp, .asc or .txt. The default is .rmp.

File
Output signature file

The output signature file.

A .gsg extension must be specified.

File
Sample interval
(Optional)

The interval to be used for sampling.

The default is 10.

Long

EditSignatures(in_raster_bands, in_signature_file, in_signature_remap_file, out_signature_file, {sample_interval})
NameExplanationData Type
in_raster_bands
[in_raster_band,...]

The input raster bands for which to edit the signatures.

They can be integer or floating point type.

Raster Layer
in_signature_file

Input signature file whose class signatures are to be edited.

A .gsg extension is required.

File
in_signature_remap_file

Input ASCII remap table containing the class IDs to be merged, renumbered, or deleted.

The extension can be .rmp, .asc or .txt. The default is .rmp.

File
out_signature_file

The output signature file.

A .gsg extension must be specified.

File
sample_interval
(Optional)

The interval to be used for sampling.

The default is 10.

Long

Code sample

EditSignatures example 1 (Python window)

This example will edit the signature file based on the input remap file.

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
EditSignatures("redl123", "c:/sapyexamples/data/zsamp12.gsg", 
               "c:/sapyexamples/data/zsamp7.rmp", 
               "c:/sapyexamples/output/redlremap.gsg", "")
EditSignatures example 2 (stand-alone script)

This example will edit the signature file based on the input remap file.

# Name: EditSignatures_Ex_02.py
# Description: Edits and updates a signature file by merging, renumbering, 
#    and deleting class signatures.
# 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 = "redl123"
oldSig = "c:/sapyexamples/data/zsamp12.gsg"
sigRemap = "c:/sapyexamples/data/zsamp7.rmp"
outNewSig = "c:/sapyexamples/output/redlsig.gsg"
interval = ""

# Execute EditSignatures
EditSignatures(inRaster, oldSig, sigRemap, outNewSig, interval)

Licensing information

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

Related topics