This document is archived and information here might be outdated.  Recommended version.


IGeometryServer2.GetLengths2 Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Geometry > ESRI.ArcGIS.Geometry > Interfaces > IG > IGeometryServer2 Interface > IGeometryServer2.GetLengths2 Method
ArcGIS Developer Help

IGeometryServer2.GetLengths2 Method

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
);
[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*

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Remarks

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.

See Also

IGeometryServer2 Interface