com.esri.arcgis.geoprocessing.tools.datamanagementtools
Class FeatureCompare
java.lang.Object
com.esri.arcgis.geoprocessing.AbstractGPTool
com.esri.arcgis.geoprocessing.tools.datamanagementtools.FeatureCompare
- All Implemented Interfaces:
- GPTool
- public class FeatureCompare
- extends AbstractGPTool
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.
The Feature Compare tool is contained in the Data Management Tools tool box.
Software restrictions: none
Usage tips:
- The tool returns messages showing the comparison result. By default the tool will stop executing after encountering the first miscompare. To report all differences, set the continue compare option to true.
- Multiple sort fields may be specified. The first field is sorted, then the second field, and so on 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.
- By default the compare type is set to ALL. This means all properties of the features being compared will be checked including such things as spatial reference, field properties, attributes, and geometry. However, you may choose a different compare type to check only specific properties of the features being compared.
- The Ignore Options provide the flexibility to omit properties such as measure attributes, z attributes, point ID attributes, and extension properties. Two feature classes may be identical, yet one has measures and z coordinates and the other does not. You can choose to ignore these properties. Extension properties are a set of additional information added to a feature class or table. For example, the features of two annotation feature classes can be identical but the feature classes may have different extension properties such as different symbols in the symbol collection and different editing behavior.
- The default XY Tolerance is determined by the default XY Tolerance of the Input Base Features. To minimize error, the value you choose for the compare tolerance should be as small as possible. If zero is entered for the XY Tolerance, an exact match is performed.
- The default M Tolerance and the default Z Tolerance is determined by the default M Tolerance and Z Tolerance of the Input Base Features. The units are the same as those of the Input Base Features. If zero is entered for the M Tolerance and Z Tolerance, an exact match is performed.
- When comparing FEATURES_ONLY, the spatial references must match. If the spatial references are different, a mis-compare will be reported. If the coordinate system is different for either input, the features will mis-compare. This tool does not do projection on the fly
- Attribute tolerances can only be specified for numeric field types.
- The Output Compare 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. For example, this table can be queried to obtain all the ObjectID values for all the rows that are different. The "has_error" field indicates that that record contains an error. True indicates there is a difference.
|
Constructor Summary |
FeatureCompare()
Creates the Feature Compare tool with defaults. |
FeatureCompare(java.lang.Object inBaseFeatures,
java.lang.Object inTestFeatures,
java.lang.Object sortField)
Creates the Feature Compare tool with the required parameters. |
|
Method Summary |
java.lang.Object |
getAttributeTolerances()
Returns the Attribute Tolerance parameter of this tool . |
java.lang.String |
getCompareStatus()
Returns the Compare Status parameter of this tool (Read only). |
java.lang.String |
getCompareType()
Returns the Compare Type parameter of this tool . |
java.lang.String |
getContinueCompare()
Returns the Continue Comparison parameter of this tool . |
java.lang.Object |
getIgnoreOptions()
Returns the Ignore Options parameter of this tool . |
java.lang.Object |
getInBaseFeatures()
Returns the Input Base Features parameter of this tool . |
java.lang.Object |
getInTestFeatures()
Returns the Input Test Features parameter of this tool . |
double |
getMTolerance()
Returns the M Tolerance parameter of this tool . |
java.lang.Object |
getOmitField()
Returns the Omit Fields parameter of this tool . |
java.lang.Object |
getOutCompareFile()
Returns the Output Compare File parameter of this tool . |
java.lang.Object |
getSortField()
Returns the Sort Field parameter of this tool . |
java.lang.String |
getToolboxAlias()
Returns the alias of the tool box containing this tool. |
java.lang.String |
getToolboxName()
Returns the name of the tool box containing this tool. |
java.lang.String |
getToolName()
Returns the name of this tool. |
java.lang.Object |
getXyTolerance()
Returns the XY Tolerance parameter of this tool . |
double |
getZTolerance()
Returns the Z Tolerance parameter of this tool . |
void |
setAttributeTolerances(java.lang.Object attributeTolerances)
Sets the Attribute Tolerance parameter of this tool . |
void |
setCompareType(java.lang.String compareType)
Sets the Compare Type parameter of this tool . |
void |
setContinueCompare(java.lang.String continueCompare)
Sets the Continue Comparison parameter of this tool . |
void |
setIgnoreOptions(java.lang.Object ignoreOptions)
Sets the Ignore Options parameter of this tool . |
void |
setInBaseFeatures(java.lang.Object inBaseFeatures)
Sets the Input Base Features parameter of this tool . |
void |
setInTestFeatures(java.lang.Object inTestFeatures)
Sets the Input Test Features parameter of this tool . |
void |
setMTolerance(double mTolerance)
Sets the M Tolerance parameter of this tool . |
void |
setOmitField(java.lang.Object omitField)
Sets the Omit Fields parameter of this tool . |
void |
setOutCompareFile(java.lang.Object outCompareFile)
Sets the Output Compare File parameter of this tool . |
void |
setSortField(java.lang.Object sortField)
Sets the Sort Field parameter of this tool . |
void |
setXyTolerance(java.lang.Object xyTolerance)
Sets the XY Tolerance parameter of this tool . |
void |
setZTolerance(double zTolerance)
Sets the Z Tolerance parameter of this tool . |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
FeatureCompare
public FeatureCompare()
- Creates the Feature Compare tool with defaults.
Initializes the array of tool parameters with the default values specified when the tool was created.
FeatureCompare
public FeatureCompare(java.lang.Object inBaseFeatures,
java.lang.Object inTestFeatures,
java.lang.Object sortField)
- Creates the Feature Compare tool with the required parameters.
Initializes the array of tool parameters with the values as specified for the required parameters and with the default values for the other parameters.
- Parameters:
inBaseFeatures - Feature Layer, 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.inTestFeatures - Feature Layer, 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.sortField - (String; String;...), 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.
getInBaseFeatures
public java.lang.Object getInBaseFeatures()
- Returns the Input Base Features parameter of this tool .
This parameter is Feature Layer, 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.
This is a required parameter.
- Returns:
- the Input Base Features
setInBaseFeatures
public void setInBaseFeatures(java.lang.Object inBaseFeatures)
- Sets the Input Base Features parameter of this tool .
This parameter is Feature Layer, 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.
This is a required parameter.
- Parameters:
inBaseFeatures - Feature Layer, 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.
getInTestFeatures
public java.lang.Object getInTestFeatures()
- Returns the Input Test Features parameter of this tool .
This parameter is Feature Layer, 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.
This is a required parameter.
- Returns:
- the Input Test Features
setInTestFeatures
public void setInTestFeatures(java.lang.Object inTestFeatures)
- Sets the Input Test Features parameter of this tool .
This parameter is Feature Layer, 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.
This is a required parameter.
- Parameters:
inTestFeatures - Feature Layer, 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.
getSortField
public java.lang.Object getSortField()
- Returns the Sort Field parameter of this tool .
This parameter is (String; String;...), 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.
This is a required parameter.
- Returns:
- the Sort Field
setSortField
public void setSortField(java.lang.Object sortField)
- Sets the Sort Field parameter of this tool .
This parameter is (String; String;...), 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.
This is a required parameter.
- Parameters:
sortField - (String; String;...), 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.
getCompareType
public java.lang.String getCompareType()
- Returns the Compare Type parameter of this tool .
This parameter is String, the comparison type. ALL is the default. The default will compare all properties of the features being compared.
This is an optional parameter.
- Returns:
- the Compare Type
setCompareType
public void setCompareType(java.lang.String compareType)
- Sets the Compare Type parameter of this tool .
This parameter is String, the comparison type. ALL is the default. The default will compare all properties of the features being compared.
This is an optional parameter.
- Parameters:
compareType - String, 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
getIgnoreOptions
public java.lang.Object getIgnoreOptions()
- Returns the Ignore Options parameter of this tool .
This parameter is String, these properties will not be compared during comparison.
This is an optional parameter.
- Returns:
- the Ignore Options
setIgnoreOptions
public void setIgnoreOptions(java.lang.Object ignoreOptions)
- Sets the Ignore Options parameter of this tool .
This parameter is String, these properties will not be compared during comparison.
This is an optional parameter.
- Parameters:
ignoreOptions - String, these properties will not be compared during comparison.-
IGNORE_M
-
IGNORE_Z
-
IGNORE_POINTID
-
IGNORE_EXTENSION_PROPERTIES
-
IGNORE_SUBTYPES
-
IGNORE_RELATIONSHIPCLASSES
getXyTolerance
public java.lang.Object getXyTolerance()
- Returns the XY Tolerance parameter of this tool .
This parameter is Linear unit, 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.
This is an optional parameter.
- Returns:
- the XY Tolerance
setXyTolerance
public void setXyTolerance(java.lang.Object xyTolerance)
- Sets the XY Tolerance parameter of this tool .
This parameter is Linear unit, 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.
This is an optional parameter.
- Parameters:
xyTolerance - Linear unit, 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.
getMTolerance
public double getMTolerance()
- Returns the M Tolerance parameter of this tool .
This parameter is Double, the measure tolerance is the minimum distance between measures before they are considered equal.
This is an optional parameter.
- Returns:
- the M Tolerance
setMTolerance
public void setMTolerance(double mTolerance)
- Sets the M Tolerance parameter of this tool .
This parameter is Double, the measure tolerance is the minimum distance between measures before they are considered equal.
This is an optional parameter.
- Parameters:
mTolerance - Double, the measure tolerance is the minimum distance between measures before they are considered equal.
getZTolerance
public double getZTolerance()
- Returns the Z Tolerance parameter of this tool .
This parameter is Double, the Z Tolerance is the minimum distance between Z coordinates before they are considered equal.
This is an optional parameter.
- Returns:
- the Z Tolerance
setZTolerance
public void setZTolerance(double zTolerance)
- Sets the Z Tolerance parameter of this tool .
This parameter is Double, the Z Tolerance is the minimum distance between Z coordinates before they are considered equal.
This is an optional parameter.
- Parameters:
zTolerance - Double, the Z Tolerance is the minimum distance between Z coordinates before they are considered equal.
getAttributeTolerances
public java.lang.Object getAttributeTolerances()
- Returns the Attribute Tolerance parameter of this tool .
This parameter is (Field Double; Field Double;...), the numeric value that determines the range in which attribute values are considered equal. This only applies to numeric field types.
This is an optional parameter.
- Returns:
- the Attribute Tolerance
setAttributeTolerances
public void setAttributeTolerances(java.lang.Object attributeTolerances)
- Sets the Attribute Tolerance parameter of this tool .
This parameter is (Field Double; Field Double;...), the numeric value that determines the range in which attribute values are considered equal. This only applies to numeric field types.
This is an optional parameter.
- Parameters:
attributeTolerances - (Field Double; Field Double;...), the numeric value that determines the range in which attribute values are considered equal. This only applies to numeric field types.
getOmitField
public java.lang.Object getOmitField()
- Returns the Omit Fields parameter of this tool .
This parameter is String, the field or fields that will be omitted during comparison. The field definitions and the tabular values for these fields will be ignored.
This is an optional parameter.
- Returns:
- the Omit Fields
setOmitField
public void setOmitField(java.lang.Object omitField)
- Sets the Omit Fields parameter of this tool .
This parameter is String, the field or fields that will be omitted during comparison. The field definitions and the tabular values for these fields will be ignored.
This is an optional parameter.
- Parameters:
omitField - String, the field or fields that will be omitted during comparison. The field definitions and the tabular values for these fields will be ignored.
getContinueCompare
public java.lang.String getContinueCompare()
- Returns the Continue Comparison parameter of this tool .
This parameter is String, indicates whether to compare all properties after encountering the first mismatch.
This is an optional parameter.
- Returns:
- the Continue Comparison
setContinueCompare
public void setContinueCompare(java.lang.String continueCompare)
- Sets the Continue Comparison parameter of this tool .
This parameter is String, indicates whether to compare all properties after encountering the first mismatch.
This is an optional parameter.
- Parameters:
continueCompare - String, 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.
getOutCompareFile
public java.lang.Object getOutCompareFile()
- Returns the Output Compare File parameter of this tool .
This parameter is 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.
This is an optional parameter.
- Returns:
- the Output Compare File
setOutCompareFile
public void setOutCompareFile(java.lang.Object outCompareFile)
- Sets the Output Compare File parameter of this tool .
This parameter is 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.
This is an optional parameter.
- Parameters:
outCompareFile - 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.
getCompareStatus
public java.lang.String getCompareStatus()
- Returns the Compare Status parameter of this tool (Read only).
This is an derived parameter.
- Returns:
- the Compare Status
getToolName
public java.lang.String getToolName()
- Returns the name of this tool.
- Returns:
- the tool name
getToolboxName
public java.lang.String getToolboxName()
- Returns the name of the tool box containing this tool.
- Returns:
- the tool box name
getToolboxAlias
public java.lang.String getToolboxAlias()
- Returns the alias of the tool box containing this tool.
- Returns:
- the tool box alias