ArcGIS API for Silverlight - Library Reference
Length(Polyline) Method
See Also  Send comments on this topic
ESRI.ArcGIS.Client.Geometry Namespace > Geodesic Class > Length Method : Length(Polyline) Method

polyline
The polyline to calculate the length for.
Calculates the length of a polyline using WGS84-ellipsoid great circles between each vertex.

Syntax

Visual Basic (Declaration) 
Public Overloads Shared Function Length( _
   ByVal polyline As Polyline _
) As Double
C# 
public static double Length( 
   Polyline polyline
)

Remarks

The term Geodesic means calculating the shortest distance between two points on a sphere. Using Geodesic algorithms to calculate distances provides a highly accurate way to obtain length and area of measurements of geographic features. The Geodesic algorithm uses the concept of a great circle to obtain the shortest route between two points along the Earth’s surface. The length and area measurements obtained via the Geodesic functions are superior to those of the Euclidian functions, as the Euclidian functions are based upon a projection (i.e. a flat 2D representation of a 3D surface) which introduces distortion.

The Geodesic.Length(Polyline) function is Shared/Static which means that you do not use the new keyword to instantiate it as an object. The output return value from the Geodesic.Length(Polyline) Method is length in meters.

The Polyline and Polygon Geometries that are used as parameters in the Geodesic functions require that the SpatialReference be in Geographic Coordinate System based upon latitude and longitude coordinates. The SpatialReference is a combination of an ellipsoid, datum, and a coordinate system used to display geographic data of the three dimensional Earth on a two dimensional surface (such as a piece of paper of computer monitor). A good article for describing how a spatial reference works can be found here. If the SpatialReference of the geometries in the layer are in a Projected Coordinate System then it will be required to converted those geometries into a Geographic Coordinate System via Methods like: Projection.WebMercator.ToGeographic or Tasks.GeometryService.ProjectAsync(IEnumerable<Graphic>,SpatialReference).

Parameters

polyline
The polyline to calculate the length for.

Return Value

Length in meters

Requirements

Target Platforms: Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows 7

See Also

© ESRI, Inc. All Rights Reserved.