Bug: GeometryEngine.Equals ignores Z coordinate of points.

267
2
10-14-2021 07:40 AM
MateuszZugaj
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
dotMorten_esri
Esri Frequent 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
Nicholas-Furness
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