Click or drag to resize

GeometryEngineEquals Method

Tests if two geometries are equal (have equivalent spatial reference systems, same geometry type, and same points).

Namespace:  Esri.ArcGISRuntime.Geometry
Assembly:  Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: 100.9.0
Syntax
public static bool Equals(
	Geometry geometry1,
	Geometry geometry2
)

Parameters

geometry1
Type: Esri.ArcGISRuntime.GeometryGeometry
The first geometry.
geometry2
Type: Esri.ArcGISRuntime.GeometryGeometry
The second geometry.

Return Value

Type: Boolean
true if geometry1 is equal to geometry2; otherwise, false.
Remarks

This method is one of several that determines the spatial relationship between two geometries. If the spatial relationship exists between the two input geometries then true is returned. If the spatial relationship does not exist between the two input geometries then false is returned. The spatial relationship test used by this method is based on the Dimensionally Extended 9 Intersection Model (DE-9IM) developed by Clementini, et al., and is discussed further in the web pages: DE-9IM and Understanding spatial relations.

The following is a visual example of when this method returns true:

GeometryEngine.Equals visual examples.

Various implementations of IsEqual(Geometry) method (i.e. IsEqual(Geometry), IsEqual(Geometry), IsEqual(Segment), IsEqual(Geometry), IsEqual(Geometry), IsEqual(Geometry), IsEqual(Segment)) provide the strictest comparison of two geometries to ensure that they are identical. For a slightly more relaxed comparison (one that does not take coordinate order into account), use Equals(Geometry, Geometry). The following table provides a comparison of these options:

geometryA.IsEqual(geometryB)GeometryEngine.Equals(geometryA,geometryB)
TypeType
ShapeShape
OrientationOrientation
Order of Coordinates--
See Also