Show / Hide Table of Contents

Method Equals

Equals(Geometry, Double)

Checks if two geometries are approximately same, within some tolerance.

Declaration
public bool Equals(Geometry geometryB, double tolerance)
Parameters
Type Name Description
Geometry geometryB

The second geometry.

System.Double tolerance

The tolerance.

Returns
Type Description
System.Boolean

true if given geometries are equal within the tolerance; otherwise false.

Remarks

This function performs a lightweight comparison of two geometries that might be useful when writing test code. It uses the tolerance to compare each of x, y, and any other values the geometries possess (such as z or m) independently in the manner: abs(value1 - value2) <= tolerance. The single tolerance value is used even if the x, y, z or m units differ. This function does not respect modular arithmetic of spatial references which wrap around, so longitudes of -180 and +180 degrees are considered to differ by 360 degrees.

Returns true if the difference of each is within the tolerance and all other properties of the geometries are exactly equal (such as spatial reference and vertex count).

For topological equality, use a relational operator such as Equals(Geometry, Geometry).

See Also
Equals(Geometry, Geometry)
IsEqual(Geometry)

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.3 - 200.7
.NET100.13 - 200.7
.NET Windows100.13 - 200.7
.NET Android200.0 - 200.7
.NET iOS200.0 - 200.7
.NET Framework100.1 - 200.7
Xamarin.Android100.1 - 100.15
Xamarin.iOS100.1 - 100.15
UWP100.1 - 200.7
In This Article
Back to top Copyright © 2022 Esri.