Calculate Layer Snapshot (Production Mapping)

License Level:BasicStandardAdvanced

Summary

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.

Usage

Syntax

CalculateLayerSnapshot_production (in_features, snapshot_field_name, {hist_string}, {history_field_name}, {date_field_name}, {username_field_name}, {output_workspace}, {reference_scale}, {refscale_field_name}, {fc_suffix})
ParameterExplanationData Type
in_features
[in_features,...]

List of feature layers to populate with snapshot information.

Layer
snapshot_field_name

The name of the field that will store the snapshot value. The field type must be LONG.

Field
hist_string
(Optional)

A string to insert 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
(Optional)

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

Code Sample

CalculateLayerSnapshot example (stand–alone script)

The following stand-alone script demonstrates how to use the CalculateLayerSnapshot tool. 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: Creates a layer snapshot on the PipeL sample data.
# Requirements: Production Mapping solution

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")

# exec the tool
arcpy.CalculateLayerSnapshot_production("PipesLyr","snapshotkey")

# check the extension in
arcpy.CheckInExtension("Foundation")
CalculateLayerSnapshot example 2 (Python window)

The following Python window script demonstrates how to use the CalculateLayerSnapshot tool. The example uses 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.CalculateLayerSnapshot_production("BuiltupP","snapshotkey","Calculate layer snapshot for BuiltupP","history","date_time","username","c:/data/outExtents.gdb",12000,"refscale","builtupP_snapshot")

Environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: No
ArcGIS for Desktop Standard: Requires Production Mapping
ArcGIS for Desktop Advanced: Requires Production Mapping
12/18/2014