GeodesicArea(Geometry,AreaUnit) Method
Gets the geodesic area of a geometry.
Parameters
- geometry
- The input geometry. Cannot be null and its spatial reference cannot be null.
- areaUnit
- The unit of the output area. If null, then the area is square meters.
Return Value
The calculated geodesic area in . If is null, the geodesic area is in square meters.
If the geometry is empty, then zero is returned.
Calculate the Geodesic Area of a polygon
var polygon = PolygonBuilderEx.CreatePolygon(new[]
{
MapPointBuilderEx.CreateMapPoint(-10018754.1713946, 10018754.1713946),
MapPointBuilderEx.CreateMapPoint(10018754.1713946, 10018754.1713946),
MapPointBuilderEx.CreateMapPoint(10018754.1713946, -10018754.1713946),
MapPointBuilderEx.CreateMapPoint(-10018754.1713946, -10018754.1713946)
}, SpatialReferences.WebMercator);
var area = GeometryEngine.Instance.GeodesicArea(polygon);
// area is close to 255032810857732.31
area = GeometryEngine.Instance.GeodesicArea(polygon, AreaUnit.SquareKilometers);
// area is close to 255032810.85953,
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3 or higher.