TIN Compare (Data Management)

Summary

Compares two TINs and returns the comparison results.

Usage

  • This tool returns messages showing the comparison result. By default, the tool will stop running after encountering the first difference between the inputs. To report all differences, check the Continue Comparison parameter.

  • This tool can report differences with geometry, TIN node and triangle tags, and spatial reference.

  • The Output Compare File parameter value will contain all similarities and differences between the Input Base TIN and Input Test TIN parameter values. This file is a comma-delimited text file that can be viewed and used as a table in ArcGIS. For example, it can be queried to obtain all the object ID values for all the rows that are different.

  • When using this tool in Python, get the status of the comparison from the returned Result object using the index position of 1.(result[1]). The value will be 'true' when no differences are found and 'false' when differences are found.

    Learn more about using tools in Python

Parameters

LabelExplanationData Type
Input Base Tin

The data that will be compared with the Input Test Tin parameter value. This parameter value is data that you have declared valid. This base data has the correct content and information.

TIN Layer
Input Test Tin

The data that will be compared with the Input Base Tin parameter value. This parameter value is data that you have made changes to by editing or compiling new information.

TIN Layer
Compare Type
(Optional)

Specifies the comparison type that will be used.

  • AllAll properties will be compared. This is the default.
  • Properties onlyBoth geometry and TIN tag values, if any, that are assigned to nodes and triangles will be compared.
  • Spatial Reference onlyCoordinate system information will be compared.
String
Continue Comparison
(Optional)

Specifies whether the comparison will continue after encountering the first difference between the inputs.

  • Unchecked—The tool will stop after encountering the first difference. This is the default.
  • Checked—The tool will continue after encountering the first difference.

Boolean
Output Compare File
(Optional)

The output file that will contain all similarities and differences between the inputs. This file is a comma-delimited text file that can be viewed and used as a table in ArcGIS.

The output file that will contain all similarities and differences between the inputs. This file is a comma-delimited text file that can be viewed and used as a table in ArcGIS.

File

Derived Output

LabelExplanationData Type
Compare Status

The compare status will be 'true' when no differences are found and 'false' when differences are found.

Boolean

arcpy.management.TINCompare(in_base_tin, in_test_tin, {compare_type}, {continue_compare}, {out_compare_file})
NameExplanationData Type
in_base_tin

The data that will be compared with the in_test_tin parameter value. This parameter value is data that you have declared valid. This base data has the correct content and information.

TIN Layer
in_test_tin

The data that will be compared with the in_base_tin parameter value. This parameter value is data that you have made changes to by editing or compiling new information.

TIN Layer
compare_type
(Optional)

Specifies the comparison type that will be used.

  • ALLAll properties will be compared. This is the default.
  • PROPERTIES_ONLYBoth geometry and TIN tag values, if any, that are assigned to nodes and triangles will be compared.
  • SPATIAL_REFERENCE_ONLYCoordinate system information will be compared.
String
continue_compare
(Optional)

Specifies whether the comparison will continue after encountering the first difference between the inputs.

  • NO_CONTINUE_COMPAREThe tool will stop after encountering the first difference. This is the default.
  • CONTINUE_COMPAREThe tool will continue after encountering the first difference.
Boolean
out_compare_file
(Optional)

The output file that will contain all similarities and differences between the inputs. This file is a comma-delimited text file that can be viewed and used as a table in ArcGIS.

File

Derived Output

NameExplanationData Type
compare_status

The compare status will be 'true' when no differences are found and 'false' when differences are found.

Boolean

Code sample

TINCompare example 1 (Python window)

The following Python window script demonstrates how to use the TINCompare function in immediate mode.

import arcpy
arcpy.management.TINCompare(r'c:\Workspace\basetin', r'c:\Workspace\newtin', 
                            'ALL', 'CONTINUE_COMPARE', 
                            r'c:\Workspace\tincompare.txt')
TINCompare example 2 (stand-alone script)

The following example demonstrates how to use the TINCompare tool in a stand-alone script.


# Description: Compare two TINs and return comparison result.

# Import system modules 
import arcpy

# Set local variables
base_tin = "C:/Workspace/basetin"
test_tin = "C:/Workspace/newtin"
compare_type = "ALL"
continue_compare = "CONTINUE_COMPARE"
compare_file = "C:/Workspace/tincompare.txt"

compare_result = arcpy.management.TINCompare(base_tin, test_tin, compare_type, 
                                             continue_compare, compare_file)
print(compare_result)
print(arcpy.GetMessages())

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics