This document is archived and information here might be outdated. Recommended version. |
ArcObjects Help for .NET developers > ArcObjects namespaces > Geometry > ESRI.ArcGIS.Geometry > Interfaces > IG > IGeometryServer2 Interface > IGeometryServer2.GetDistance Method (ArcObjects .NET 10.5 SDK) |
Reports shortest distance between G1 and G2.
[Visual Basic .NET] Public Function GetDistance ( _ ByVal pSR As ISpatialReference, _ ByVal pG1 As IGeometry, _ ByVal pG2 As IGeometry, _ ByVal pDistanceUnit As ILinearUnit _ ) As Double
[C#] public double GetDistance ( ISpatialReference pSR, IGeometry pG1, IGeometry pG2, ILinearUnit pDistanceUnit );
[C++]
HRESULT GetDistance(
ISpatialReference* pSR,
IGeometry* pG1,
IGeometry* pG2,
ILinearUnit* pDistanceUnit,
double* pDistance
);
[C++]
Parameters pSR
pSR is a parameter of type ISpatialReference pG1
pG1 is a parameter of type IGeometry pG2
pG2 is a parameter of type IGeometry pDistanceUnit
pDistanceUnit is a parameter of type ILinearUnit pDistance [out, retval] pDistance is a parameter of type double
The distance value is computed in the specified linear units, if present, or in the units of the spatial reference. It is not recommended that this method be used on geometries with lat-long coordinates. Use GetDistanceGeodesic instead.