Show / Hide Table of Contents

Method LengthGeodetic

LengthGeodetic(Geometry, LinearUnit?, GeodeticCurveType)

Gets the geodesic length for the Geometry passed in.

Declaration
public static double LengthGeodetic(this Geometry geometry, LinearUnit? linearUnit = null, GeodeticCurveType geodeticCurveType = GeodeticCurveType.Geodesic)
Parameters
Type Name Description
Geometry geometry

The geometry to calculate the geodesic length for.

LinearUnit linearUnit

The linear unit of measurement the length value is returned. If null, meters are assumed.

GeodeticCurveType geodeticCurveType

The type of curve to calculate.

Returns
Type Description
double

The calculated geodesic length in the requested unit.

Remarks

Geodesic length is calculated using only the vertices of the polygon and define the lines between the points as geodesic segments independent of the actual shape of the polygon. A geodesic segment is the shortest path between two points on an ellipsoid. Thus, if you have a line that spans the width of the world, with only two vertices, each on the edges of the map, the geodesic length would be zero (shortest distance between the two vertices).

Supports true curves, calculating the result by densifying curves.

Exceptions
Type Condition
ArgumentException

Indicates that the provided geometry does not have a spatial reference.

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.3 - 200.8
.NET100.13 - 300.0
.NET Windows100.13 - 300.0
.NET Android200.0 - 300.0
.NET iOS200.0 - 300.0
.NET Framework100.0 - 200.8
Xamarin.Android100.0 - 100.15
Xamarin.iOS100.0 - 100.15
UWP100.0 - 200.8
Relevant samples
Geodesic operations: Calculate a geodesic path between two points and measure its distance.
In this article
Provide feedback
Back to top Copyright © 2025 Esri.