Sign up ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Does the IGeometryServer2 interface work in desktop applications? My solution is an Add-in for ArcGIS 10. I'm currently passing it two valid polygon features that are in a projected coordinate system. I call the GetDistanceGeodesic() method in the following manner but it always returns infinity.

IGeometryServer2 geomServer2 = new GeometryServerClass();
var PCS = distFeat.ShapeCopy.SpatialReference as IProjectedCoordinateSystem;    
ILinearUnit unit = PCS.CoordinateUnit;    
double _dTestDist = geomServer2.GetDistanceGeodesic(distFeat.ShapeCopy.SpatialReference, distFeat.Shape, distFeat2.Shape, unit);

All the inputs have the expected values while stepping through in debug mode. I also tried using WGS84 but the results were the same.

share|improve this question
Somewhat related (you might need to use pe.dll for this): – blah238 Apr 17 '13 at 23:05
Thanks, I did see that question. I was hoping to get this interface working to simplify things. – Rich Wawrzonek Apr 17 '13 at 23:22
@Rich Wawrzonek Hi, are you going to use ArcGIS Server? GeometryServerClass is GeometryService which hosted by ArcGIS Server. – Darksanta Apr 17 '13 at 23:36
No, this application is for desktop. One polygon comes from a file geodatabase feature class and the other from the ArcMap user interface (in memory). – Rich Wawrzonek Apr 18 '13 at 0:29
You can take a look at According to that, after 10.0 sp2 you can calculate geodesic distances using the Calculate Field tool. – travis Apr 18 '13 at 0:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.