Gets the length for a specified Geometry. This is a planar measurement using 2D Cartesian mathematics to compute the length in the same coordinate space as the inputs. Use LengthGeodetic(Geometry, LinearUnit, GeodeticCurveType) for geodetic measurement.
public static double Length(Geometry geometry)
The geometry to calculate length for.
The calculated length in the same units as the geometry's spatial reference unit.
This length calculation is based upon the SpatialReference of the input geometry. Although some projections are better than others for preserving distance, it will always be distorted in some areas of the map. Distortion may be negligible for large scale maps (small areas) that use a suitable map projection. Make sure you know your data and spatial reference if accurate measurements are required. For more accurate results, consider using the LengthGeodetic(Geometry, LinearUnit, GeodeticCurveType) operation.
Supports true curves.
Platforms and versions
|.NET Standard 2.0||100.3 - 100.14|
|.NET 6.0||100.13 - 100.14|
|.NET 6.0 Windows||100.13 - 100.14|
|.NET Framework||100.0 - 100.14|
|.NET 5||100.10 - 100.12|
|.NET Core 3.1||100.7 - 100.12|
|Xamarin.Android||100.0 - 100.14|
|Xamarin.iOS||100.0 - 100.14|
|UWP||100.0 - 100.14|