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.GetLengths2 Method (ArcObjects .NET 10.5 SDK) |
Calculates the length of eacch polyline in the specified array. Optionally does unit conversion.
[Visual Basic .NET] Public Function GetLengths2 ( _ ByVal pSR As ISpatialReference, _ ByVal pInPolylines As IPolylineArray, _ ByVal pLengthUnit As ILinearUnit _ ) As IDoubleArray
[C#] public IDoubleArray GetLengths2 ( ISpatialReference pSR, IPolylineArray pInPolylines, ILinearUnit pLengthUnit );
[C++]
HRESULT GetLengths2(
ISpatialReference* pSR,
IPolylineArray* pInPolylines,
ILinearUnit* pLengthUnit,
IDoubleArray** ppLengths
);
[C++]
Parameters pSR
pSR is a parameter of type ISpatialReference pInPolylines
pInPolylines is a parameter of type IPolylineArray pLengthUnit
pLengthUnit is a parameter of type ILinearUnit ppLengths [out, retval]
ppLengths is a parameter of type IDoubleArray
The length values are 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 having latitude-longitude coordinates, since the length would then be calculated in units of "degrees". You can use the GetLengthsGeodesic method to compute accurate lengths for polylines with latitude-longitude coordinates.