Calculate Layer Snapshot (Production Mapping)
Zusammenfassung
Calculates a snapshot of a feature layer by creating a snapshot value of feature geometry, extent, and symbology. The tool stores the snapshot value in a long integer field in the Input Features feature class. The Compare Layer To Snapshot tool uses the snapshot value to identify changes to geometry, extent, and symbology in a layer across multiple map documents.
The tool can optionally populate metadata including date and time, user name, reference scale, and an historical string. Metadata is also written to the Input Features feature class.
Verwendung
This tool accepts points, polylines, polygons, and annotation feature layers as input.
-
Use the Compare Layer To Snapshot tool to identify feature shape, extent, and symbology changes in a layer across multiple map documents.
You must add a long integer field to the Input Features feature class before running this tool. This field stores the snapshot value created by this tool. You can choose any name for this field as long as it is valid in their data source (workspace).
You can optionally add snapshot metadata to the Input Features feature class. This requires that you add the following fields to the Input Features feature class. You can choose any names for these fields as long as they are valid in their data source (workspace).
- A TEXT field for Historical String Field.
- A TEXT field for User Name Field.
- A DATE field for Date and Time Field.
If you set the Output Workspace parameter, the tool will execute Feature Outline Masks. This will generate an output polygon feature class in the path set in Output Workspace. You can rename the output feature class using the Output Feature Class Suffix parameter.
If you set snapshot metadata fields and the Output Workspace parameter, the tool will write the metadata to the feature class created by Feature Outline Masks.
You can only set Reference Scale if you set an Output Workspace. The tool writes the reference scale to the feature class created by Feature Outline Masks.
The reference scale is the scale at which a symbol appears at its true size. The reference scale is derived in the following order:
- The geoprocessing reference scale environment setting
- The active data frame’s reference scale
- The value of the Reference Scale parameter
All feature layers listed in Input Features must have a set of commonly named attributes. For example, all feature layers must have the same name for their Snapshot Field.
To execute this tool in ArcCatalog, use the Make Feature Layer tool from the Python window to create a feature layer from Input Features.
Syntax
Parameter | Erläuterung | Datentyp |
input_features [input_features,...] |
List of feature layers to populate with snapshot information. | Feature Layer |
extent_field_name | The name of the field that will store the snapshot value. The field type must be LONG. | Field |
hist_string (optional) |
The tool will insert any dataset in hist_string into the history_field_name field. Use to define a custom historical note. | String |
history_field_name (optional) |
The name of the field that will store the historical string. The field type must be TEXT. | Field |
date_field_name (optional) | The name of the field that will store date and time values. The field type must be DATE. | Field |
username_field_name (optional) |
The name of the field that will store a user name. The field type must be TEXT. | Field |
output_workspace (optional) |
The workspace that will store the output of Feature Outline Masks. This parameter requires that you set reference_scale and refscale_field_name. | Workspace |
reference_scale | The scale in which a symbol appears at its true size. The Feature Outline Masks tool uses reference scale to calculate masking geometry. This parameter requires that you set output_workspace first. | Double |
refscale_field_name (optional) | The name of the field that will store the reference_scale value. The tool creates this field in the output feature class created by Feature Outline Masks . This parameter requires that you set output_workspace first. | String |
fc_suffix (optional) |
The suffix that will be appended to the feature layer name specified in input_features. The suffix defaults to _LayerSnapshot. | String |
output_Layers (optional) |
Output feature layers created by Feature Outline Masks. | Table View |
Codebeispiel
This stand-alone script demonstrates how to use CalculateLayerSnapshot. This script references the PipeL feature class in the SoCal_Sample.gdb geodatabase. This geodatabase is included with the Production Mapping sample data.
# Name: CalculateLayerSnapshot_Standalone.py # Description: # Author: ESRI # Date: March 2010 import arcpy # check out a foundation license arcpy.CheckOutExtension("Foundation") # Use the PipesL feature class from the Production Mapping sample data PipesL = r'C:\data\Foundation_Data_Tutorials\ProductLibrary\GDB\SoCal_Sample.gdb\PipeL' # CalculateLayerSnapshot tool requires a feature layer arcpy.MakeFeatureLayer(PipesL,"PipesLyr") # import the toolbox arcpy.ImportToolbox(r"C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Production Mapping Tools.tbx") # exec the tool arcpy.CalculateLayerSnapshot_production("PipesLyr","snapshotkey") # check the extension in arcpy.CheckInExtension("Foundation")
The following ArcGIS Python window script demonstrates how to use the CalculateLayerSnapshot function with all parameters. This script references the BuiltupP feature class in the SoCal.gdb geodatabase. This geodatabase is included with the Production Mapping sample data. Run the script from the Python window of ArcCatalog or ArcMap.
arcpy.MakeFeatureLayer_management(r'C:\data\Foundation_Data_Tutorials\ProductLibrary\GDB\SoCal_Sample.gdb\BuiltupP',"BuiltupP") arcpy.AddField_management("BuiltupP","snapshotkey","LONG") arcpy.AddField_management("BuiltupP","history","TEXT") arcpy.AddField_management("BuiltupP","date_time","DATE") arcpy.AddField_management("BuiltupP","username","TEXT") arcpy.CreateFileGDB_management("c:/data","outExtents.gdb") arcpy.ImportToolbox(r"C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Production Mapping Tools.tbx") arcpy.CalculateLayerSnapshot_production("BuiltupP","snapshotkey","Calculate layer snapshot for BuiltupP","history","date_time","username","c:/data/outExtents.gdb",12000,"refscale","builtupP_snapshot")