Bug: GeometryEngine.Equals ignores Z coordinate of points.

10-14-2021 07:40 AM
New Contributor II

Version Esri.ArcGISRuntime 100.12. Tested both in dotnet core and dotnet framework.


GeometryEngine.Equals(new MapPoint(0,0,1),new MapPoint(0,0,2)) returns true.


I reproduced it in a blank project, so no prerequsited needed.

Tags (2)
0 Kudos
2 Replies
Esri Notable Contributor

This is a known limitation in the geometry engine.

From https://developers.arcgis.com/net/api-reference/api/netwin/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Geo... :


> GeometryEngine generally operates in two dimensions; operations do not account for z-values unless documented as such for a specific method (for example Project(Geometry, SpatialReference) will transform z-values in some cases).


0 Kudos
Esri Regular Contributor

If you're interested in a full, exact geometry comparison, including Z and M values, you can use Geometry.IsEqual(). Depending on your use case, you might also find Geometry.Equals() helpful, which allows you to specify a tolerance.

0 Kudos