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

03-05-2018 02:02 AM
New Contributor

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,


0 Kudos
1 Reply
Esri Frequent Contributor

Normally I'd ask for the JSON of the geometries so we can use it to reproduce the issue, but it seems like parsing from JSON fixes the issue.

Is there any way you'd be able to share a stand-alone reproducer sample with me (for instance a unit test snippet?), so I can submit it to the geometry team?

0 Kudos