Calculate Layer Snapshot (Production Mapping)

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 (input_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
input_features
[input_features,...]

List of feature layers to populate with snapshot information.

Feature 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

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 1 (Stand–alone Python script)

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")
CalculateLayerSnapshot example 2 (Python window)

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

Environments

This tool does not use any geoprocessing environments

Related Topics

Licensing Information

ArcView: No
ArcEditor: Requires Production Mapping
ArcInfo: Requires Production Mapping

5/4/2011