ArcGIS Pro 2.7 API Reference Guide
GeodesicLength Method (GeometryEngine)
Example 

ArcGIS.Core.Geometry Namespace > GeometryEngine Class : GeodesicLength Method
The input geometry.
Gets the geodesic length of the input geometry.
Syntax
public double GeodesicLength( 
   Geometry geometry
)
Public Function GeodesicLength( _
   ByVal geometry As Geometry _
) As Double

Parameters

geometry
The input geometry.

Return Value

The calculated geodesic length. If the geometry's spatial reference is a geographic coordinate system, the length is returned in meters. If the geometry's spatial reference is a projected coordinate system, the length is returned in the units of the spatial reference.
Exceptions
ExceptionDescription
Geometry is null or empty.
The method is not implemented for GeometryBag or Multipatch.
Spatial reference of geometryis an image coordinate system.
Remarks
Geodesic length is calculated by using only the vertices of the polygon and defining the segments 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. For example, if you have a closed polyline with only two vertices that represents the equator, the length returned will be zero.
Example
List<Coordinate2D> coords = new List<Coordinate2D>()
{
  new Coordinate2D(-80, 0),
  new Coordinate2D(-20, 60),
  new Coordinate2D(40, 20),
  new Coordinate2D(0, -20),
  new Coordinate2D(-80, 0)
};

SpatialReference sr = SpatialReferences.WGS84;

// create a polygon
Polygon polygon = PolygonBuilder.CreatePolygon(coords, sr);

// get the geodesic lengths of the polygon segments
ReadOnlySegmentCollection segments = polygon.Parts[0];
List<Double> geoLengths = new List<Double>(segments.Count);
foreach (Segment s in segments)
{
  Polyline line = PolylineBuilder.CreatePolyline(s, sr);
  double geoLen = GeometryEngine.Instance.GeodesicLength(line);
  geoLengths.Add(geoLen);
}

// find the max length
geoLengths.Sort();
double maxLen = geoLengths[geoLengths.Count - 1];

// densify the polygon (in meters)
Polygon densifiedPoly = GeometryEngine.Instance.GeodeticDensifyByLength(polygon, maxLen, LinearUnit.Meters, GeodeticCurveType.Geodesic) as Polygon;

// densify the polygon (in km)
double maxSegmentLength = maxLen / 10000;
densifiedPoly = GeometryEngine.Instance.GeodeticDensifyByLength(polygon, maxSegmentLength, LinearUnit.Kilometers, GeodeticCurveType.Geodesic) as Polygon;
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

GeometryEngine Class
GeometryEngine Members