AnsweredAssumed Answered

GeometryEngine Error: "...must have equivalent spatial references"

Question asked by k.gispergmysynergis-esridist Employee on Mar 5, 2018
Latest reply on May 24, 2018 by mnielsen-esristaff

Dear Esri Team!


We implement an application with ArcGIS Runtime 100.1 (and 100.2), using .NET Framwork 4.5.2 and VS2015, and running on Windows 10


Most of the geometry operations in the GeometryEngine fail with a "...must have equivalent spatial references" exception.


Geometry geoCliptest = GeometryEngine.Clip(feat.Geometry, extent);

{"Invalid argument: geometry and envelope must have equivalent spatial references."}

   bei Esri.ArcGISRuntime.ArcGISException.HandleCoreError(CoreError error, Boolean throwException)

   bei RuntimeCoreNet.GeneratedWrappers.Interop.CheckError(IntPtr errorHandle, Boolean throwOnFailure, GCHandle wrapperHandle)

   bei RuntimeCoreNet.GeneratedWrappers.CoreGeometryEngine.Clip(CoreGeometry geometry, CoreEnvelope envelope)

   bei Esri.ArcGISRuntime.Geometry.GeometryEngine.Clip(Geometry geometry, Envelope envelope)


In this example we use the MapView Extent and the geometry from a feature.

We compared the Spatial References with 

var test = feat.Geometry.SpatialReference.IsEqual(extent.SpatialReference);

and it returned true.

And manually checked, the wktstrings are equal too:



We created a workaround for our low level operations. Now we convert the geometry parameters like this, and everything works without problems:


public static Polygon ConvertPolygon(

            Polygon p)


            var pJson = p.ToJson( );

            Polygon newPolygon = Geometry.FromJson( pJson ) as Polygon;

            return newPolygon;



So what is the problem? I cannot evaluate the side effects of this  workaround, so it cannot stay like this.


Thanks in advance,