Summary
Edit and update feature files by merging, renumbering, and deleting class features.
Usage
· The Edit features tool allows you to modify an existing signature file by any of the following actions or actions:
Merging a set of feature classes
Renumber feature class ID
Remove unwanted features
· The input signature file must be an ASCII signature file. The file can be any output that is used to generate a "Multivariate analysis" tool (such as ISO clustering and create features) that contains the required statistics. The file must contain a minimum of two classes. This type of file can be identified by the. gsg extension.
· The input feature remap file is an ASCII file that has two columns of values corresponding to each row, separated by colons. The first column is the original class ID value. The second column contains the new class ID for updating in the signature file. All entries in the file must be sorted in ascending order based on the first column.
To merge a set of classes, place the same new class ID for the second value of the group's various IDs. Only classes that need to be edited must be placed in the feature remap file; Any classes that do not exist in the remap file will remain unchanged. To delete a class feature, use 9999 as the value of the second column of the class. In addition, the class ID can be renumbered to a value that does not exist in the input signature file. The following is an example of an input feature remap file:
2:3
4:11
5:-9999
9:3
The example above will use 3 to merge classes 2 and 9, use 11 to merge Class 4, and delete Class 5.
· If the input signature file contains a class feature name, and the features in the input feature remap file are to be merged, the associated name of the merged value is transferred to the output signature file.
· If you enter a layer created from a multiband raster (more than three bands), the operation takes into account all the bands associated with the source dataset, not just the three bands loaded (symbolized) by the layer.
· You can specify a subset of bands for a multiband raster as input to the tool in several ways.
· If you want to use the tool dialog box, navigate to the multi-band raster by the button next to the input raster bands, open the grid, and select the desired band.
· If the multiband raster is a layer in the table of contents, you can use the Create Raster Layer tool to create a new multiband layer that contains only the desired bands.
· You can also use band compositing to create a new dataset that contains only the desired bands and use the resulting dataset as input to the tool.
· In Python, you can specify the desired bands directly in the tool parameters as a list.
Grammar
Editsignatures (In_raster_bands, In_signature_file, In_signature_remap_file, Out_signature_file, {sample_interval})
Code instance
editsignatures Example 1 (Python window)
This example edits 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 edits 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 = ""
# Check out the ArcGIS Spatial Analyst extension License
arcpy. Checkoutextension ("Spatial")
# Execute Editsignatures
Editsignatures (Inraster, Oldsig, Sigremap, Outnewsig, Interval)
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
ArcGIS Tutorial: Editing features