Select to view content in your preferred language

Incompatible Spatial References

2167
11
10-29-2020 09:04 AM
AlexZlotin1
Emerging Contributor

In the Pro SDK API, I am getting the "Incompatible spatial references" error when performing Geometry Engine operations like Distance or Difference on two geometries. The first geometry comes from a feature in an enterprise geodatabase feature class contained in a feature dataset. The second feature comes from a file geodatabase feature class created programmatically, with the spatial reference copied from the SDE feature class. When I look at spatial references of both geometry objects in debug mode, they have identical WKT strings. The workaround I found was to convert both geometries to JSON and re-create them from the JSON strings. The Geometry Engine operations no longer fail.  

My understanding is that as long as spatial reference WKT strings for two geometries are identical, their spatial references are the same. Is there something I am missing? Could this possibly be a bug? 

I am using Pro 2.6 SDK. Thanks.

11 Replies
RadekMandovec
Regular Contributor

Just a small note. The feature with XYTolerance = 0.0002 is the one I obtained by clicking on the map.

 var mapPoint = MapView.Active.ClientToMap(e.ClientPoint);

I tried to find out whether the Map itself has any XYTolerance, but I couldn’t find anything anywhere, so I actually don’t know where the point gets its XYTolerance from. However, it definitely differs from the XYTolerance of all connected feature classes.

0 Kudos
RadekMandovec
Regular Contributor

Thanks a lot.