Compare Layer to Snapshot (Production Mapping)


This tool, in conjunction with Calculate Layer Snapshot, selects features that have had geometry, extent, or symbology changes.



CompareLayerToSnapshot_production (input_features, snapshot_field_name, {invert_selection})
ParameterExplanationData Type

The input list of feature layers and feature classes to check for geometry and symbology changes.

Feature Layer

The field name containing the checksum values created by Calculate Layer Snapshot.


Specifies if the tool should select changed features or invert the selection to unchanged features.

  • TRUESelect only features whose geometries, extents, and symbols have not changed.
  • FALSESelect only features whose geometries, extents, and symbols have changed. This is the default.

Code Sample

CompareLayerToSnapshot example 1 (Python window)

The following Python window script demonstrates how to use the CompareLayerToSnapshot function with Production Mapping sample data. The script executes the CompareLayerToSnapshot tool and then checks for any selected features using the Describe function. The script writes any selected features to a new feature class, ChangedPoliticalBounds in the C:/data/SoCal.gdb database. To use this script:

  1. Add the PolbndA feature class from the SoCal.gdb sample database to ArcMap.
  2. Add a long integer field to PolbndA called polbnd_extent_info.
  3. Run the CalculateLayerSnapshot tool against PolbndA, selecting polbnd_extent_info as the Snapshot Field.
  4. Change the symbology of PolbndA in ArcMap.
  5. Add the following code to the python window in ArcMap.

arcpy.env.workspace = "C:/data/SoCal.gdb"
arcpy.ImportToolbox(r"C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Production Mapping Tools.tbx")
desc = arcpy.Describe("PolbndA")
selectedFids = desc.FIDSet
if len(selectedFids) > 0:
CompareLayerToSnapshot example 2 (Stand–alone Python script)

The following stand-alone Python script demonstrates how the CompareLayerToSnapshot tool will select features that have been changed by extent, geometry or symbology. This example uses changes in symbology. To run this script:

  1. Copy the SoCal.gdb sample Production Mapping geodatabase to c:\data.
  2. Display the PolbndA feature class in ArcMap.
  3. Add a new field, pol_ext_info, type LONG, to PolbndA.
  4. Run the Calculate Layer Snapshot on PolbndA, using the pol_ext_info field as an input.
  5. Close ArcMap and run the following script.

# Name:
# Description: Writes changed features (in this example - symbols) to a new feature class
# Author: ESRI
# Date: March 2010

import arcpy

# check out a production mapping extension license

# set the current workspace
arcpy.env.workspace = "C:/data/SoCal.gdb"

# make a feature layer from the PolbndA feature class

# import the production mapping toolbox
arcpy.ImportToolbox(r"C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Production Mapping Tools.tbx")

# check for changed features in the pol_ext_info field

# describe the feature layer to access the the selected set
desc = arcpy.Describe("polbndlayer")

# FIDSet will contain the selected features
selectedFids = desc.FIDSet

# As the symbol in polbndlayer is different than what was written in
# the pol_ext_info field, there should be a selection set.
# If there are selectedFids (a selection set), write them to a new feature
# class in the current workspace.
if len(selectedFids) > 0:

# check the extension in


This tool does not use any geoprocessing environments

Related Topics

Licensing Information

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