ArcObjects Library Reference (Geometry)  

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,
  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

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