Checks if two geometries are approximately same, within some tolerance.
Namespace:
Esri.ArcGISRuntime.Geometry
Assembly:
Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: 100.9.0
Syntaxpublic bool Equals(
Geometry geometryB,
double tolerance
)
Public Function Equals (
geometryB As Geometry,
tolerance As Double
) As Boolean
Parameters
- geometryB
- Type: Esri.ArcGISRuntime.GeometryGeometry
The second geometry. - tolerance
- Type: SystemDouble
The tolerance.
Return Value
Type:
Booleantrue if given geometries are equal within the tolerance; otherwise
false.
Remarks
This function performs a lightweight comparison of two geometries, such as 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. Returns
true if the difference of each is within the tolerance and
all other properties of the geometries are exactly equal (spatial reference, vertex count, etc). A single tolerance is
used even if the units for the horizontal coordinates and other values differ, e.g. horizontal coordinates in degrees and
vertical coordinates in meters. 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
false if an error
occurs. To test for topological equality, use relational operators provided by
GeometryEngine.
See Also