Show Navigation | Hide Navigation
You are here:
Geoprocessing tool reference > Data Management toolbox > Data Comparison toolset > Tools

Feature Compare (Data Management)

Release 9.2
Last modified November 29, 2010
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Tools"


Related Topics

Compares two feature classes or layers and returns the comparison results. Feature Compare can report differences with geometry, tabular values, spatial reference, and field definitions.


Usage tips

Command line syntax
An overview of the Command Line window
FeatureCompare_management <in_base_features> <in_test_features> {sort_field;sort_field...} {ALL | GEOMETRY_ONLY | ATTRIBUTES_ONLY | SCHEMA_ONLY | SPATIAL_REFERENCE_ONLY} {IGNORE_M | IGNORE_Z | IGNORE_POINTID | IGNORE_EXTENSION_PROPERTIES} {xy_tolerance} {m_tolerance} {z_tolerance} {Field {Tolerance};Field {Tolerance}...} {omit_field;omit_field...} {NO_CONTINUE_COMPARE | CONTINUE_COMPARE} {out_compare_file}

Parameter Explanation Data Type
<in_base_features>

The Input Base Features are compared with the Input Test Features. Input Base features refers to your data that you have declared valid. This base data has the correct geometry definitions, field definitions, and spatial reference.

Feature Layer
<in_test_features>

The Input Test Features are compared against the Input Base Features. Input Test Features refers to your data that you have made changes by editing or compiling new features.

Feature Layer
{sort_field;sort_field...}

The field or fields used to sort records in the Input Base Table and the Input Test Table. The records are sorted in ascending order. Sorting by a common field in both the Input Base Features and the Input Test Features ensures that you are comparing the same row from each input dataset.

(String; String;...)
{ALL | GEOMETRY_ONLY | ATTRIBUTES_ONLY | SCHEMA_ONLY | SPATIAL_REFERENCE_ONLY}

The comparison type. ALL is the default. The default will compare all properties of the features being compared.

  • ALL
  • GEOMETRY_ONLY
  • ATTRIBUTES_ONLY
  • SCHEMA_ONLY
  • SPATIAL_REFERENCE_ONLY

String
{IGNORE_M | IGNORE_Z | IGNORE_POINTID | IGNORE_EXTENSION_PROPERTIES}

These properties will not be compared during comparison.

  • IGNORE_M
  • IGNORE_Z
  • IGNORE_POINTID
  • IGNORE_EXTENSION_PROPERTIES
  • IGNORE_SUBTYPES
  • IGNORE_RELATIONSHIPCLASSES

String
{xy_tolerance}

The distance that determines the range in which features are considered equal. To minimize error, the value you choose for the compare tolerance should be as small as possible. By default the compare tolerance is zero which means the geometries must be exact.

Linear unit
{m_tolerance}

The measure tolerance is the minimum distance between measures before they are considered equal.

Double
{z_tolerance}

The Z Tolerance is the minimum distance between Z coordinates before they are considered equal.

Double
{Field {Tolerance};Field {Tolerance}...}

The numeric value that determines the range in which attribute values are considered equal. This only applies to numeric field types.

(Field Double; Field Double;...)
{omit_field;omit_field...}

The field or fields that will be omitted during comparison. The field definitions and the tabular values for these fields will be ignored.

String
{NO_CONTINUE_COMPARE | CONTINUE_COMPARE}

Indicates whether to compare all properties after encountering the first mismatch.

  • NO_CONTINUE_COMPARE — Stop after encountering the first mismatch. This is the default.
  • CONTINUE_COMPARE — Compare other properties after encountering the first mismatch.

Boolean
{out_compare_file}

This file will contain all similarities and differences between the Input Base Features and the Input Test Features. This file is a comma delimited text file which can be viewed and used as a table in ArcGIS.

File
Data types for geoprocessing tool parameters


Command line example

FeatureCompare_management c:\workspace\baseroads.shp c:\workspace\newroads.shp ROAD_ID ALL IGNORE_M;IGNORE_Z '0.001 METERS' 0 0 'Shape_Length 0.001' # CONTINUE_COMPARE C:\workspace\roadcompare.txt

Scripting syntax
About getting started with writing geoprocessing scripts
FeatureCompare_management (in_base_features, in_test_features, sort_field, compare_type, ignore_options, xy_tolerance, m_tolerance, z_tolerance, attribute_tolerances, omit_field, continue_compare, out_compare_file)

Parameter Explanation Data Type
in_base_features (Required)

The Input Base Features are compared with the Input Test Features. Input Base features refers to your data that you have declared valid. This base data has the correct geometry definitions, field definitions, and spatial reference.

Feature Layer
in_test_features (Required)

The Input Test Features are compared against the Input Base Features. Input Test Features refers to your data that you have made changes by editing or compiling new features.

Feature Layer
sort_field (Optional)

The field or fields used to sort records in the Input Base Table and the Input Test Table. The records are sorted in ascending order. Sorting by a common field in both the Input Base Features and the Input Test Features ensures that you are comparing the same row from each input dataset.

(String; String;...)
compare_type (Optional)

The comparison type. ALL is the default. The default will compare all properties of the features being compared.

  • ALL
  • GEOMETRY_ONLY
  • ATTRIBUTES_ONLY
  • SCHEMA_ONLY
  • SPATIAL_REFERENCE_ONLY

String
ignore_options (Optional)

These properties will not be compared during comparison.

  • IGNORE_M
  • IGNORE_Z
  • IGNORE_POINTID
  • IGNORE_EXTENSION_PROPERTIES
  • IGNORE_SUBTYPES
  • IGNORE_RELATIONSHIPCLASSES

String
xy_tolerance (Optional)

The distance that determines the range in which features are considered equal. To minimize error, the value you choose for the compare tolerance should be as small as possible. By default the compare tolerance is zero which means the geometries must be exact.

Linear unit
m_tolerance (Optional)

The measure tolerance is the minimum distance between measures before they are considered equal.

Double
z_tolerance (Optional)

The Z Tolerance is the minimum distance between Z coordinates before they are considered equal.

Double
attribute_tolerances (Optional)

The numeric value that determines the range in which attribute values are considered equal. This only applies to numeric field types.

(Field Double; Field Double;...)
omit_field (Optional)

The field or fields that will be omitted during comparison. The field definitions and the tabular values for these fields will be ignored.

String
continue_compare (Optional)

Indicates whether to compare all properties after encountering the first mismatch.

  • NO_CONTINUE_COMPARE — Stop after encountering the first mismatch. This is the default.
  • CONTINUE_COMPARE — Compare other properties after encountering the first mismatch.

Boolean
out_compare_file (Optional)

This file will contain all similarities and differences between the Input Base Features and the Input Test Features. This file is a comma delimited text file which can be viewed and used as a table in ArcGIS.

File

Data types for geoprocessing tool parameters


Script example

# FeatureCompare.py
# Description: Compare two feature classes and return comparison result.
# Requirements: None
# Author: ESRI
# Date: 06/21/05

# Create the Geoprocessing Object
import arcgisscripting, sys, os
gp = arcgisscripting.create()

try:
    # Set local variables
    base_features = "C:/Workspace/baseroads.shp"
    test_features = "C:/Workspace/newroads.shp"
    sort_field = "ROAD_ID"
    compare_type = "ALL"
    ignore_option = "IGNORE_M;IGNORE_Z"
    xy_tolerance = "0.001 METERS"
    m_tolerance = 0
    z_tolerance = 0
    attribute_tolerance = "Shape_Length 0.001"
    omit_field = "#"
    continue_compare = "CONTINUE_COMPARE"
    compare_file = "C:/Workspace/roadcompare.txt"

    # Process: FeatureCompare
    compare_result = gp.FeatureCompare_management(base_features, test_features, sort_field, compare_type, ignore_option, xy_tolerance, m_tolerance, z_tolerance, attribute_tolerance, omit_field, continue_compare, compare_file)
    print compare_result
    print gp.GetMessages()

except:
    # Print error message if an error occurs
    print gp.GetMessages()

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.