ArcGIS Pro 2.9 API Reference Guide
ShapePreservingArea(Geometry) Method
Example 

ArcGIS.Core.Geometry Namespace > GeometryEngine Class > ShapePreservingArea Method : ShapePreservingArea(Geometry) Method
The input geometry. Cannot be null and its spatial reference cannot be null.
Calculates the area of the geometry on the surface of the Earth ellipsoid. This method preserves the shape of the geometry in its coordinate system.
Syntax
public double ShapePreservingArea( 
   Geometry geometry
)
Public Overloads Function ShapePreservingArea( _
   ByVal geometry As Geometry _
) As Double

Parameters

geometry
The input geometry. Cannot be null and its spatial reference cannot be null.

Return Value

The calculated shape preserving area of the geometry in square meters. If the geometry is empty, then zero is returned.
Exceptions
ExceptionDescription
Geometry is null.
The method is not implemented for GeometryBag or Multipatch.
Geometry is missing a spatial reference.
Spatial reference of geometryis an image coordinate system.
Example
// pt
MapPoint pt = MapPointBuilder.CreateMapPoint(1.0, 3.0, SpatialReferences.WebMercator);
double area = GeometryEngine.Instance.ShapePreservingArea(pt);         // area = 0

List<MapPoint> pts = new List<MapPoint>();
pts.Add(MapPointBuilder.CreateMapPoint(1.0, 1.0, 3.0));
pts.Add(MapPointBuilder.CreateMapPoint(1.0, 3.0, 3.0));
pts.Add(MapPointBuilder.CreateMapPoint(3, 3, 3.0));
pts.Add(MapPointBuilder.CreateMapPoint(3.0, 1.0, 3.0));

// multipoint
Multipoint mPt = MultipointBuilder.CreateMultipoint(pts);
area = GeometryEngine.Instance.ShapePreservingArea(mPt);               // area = 0

// polyline
Polyline polyline = PolylineBuilder.CreatePolyline(pts);
area = GeometryEngine.Instance.ShapePreservingArea(polyline);          // area = 0

// polygon
Polygon polygon = PolygonBuilder.CreatePolygon(pts, SpatialReferences.WGS84);
area = GeometryEngine.Instance.ShapePreservingArea(polygon);

polygon = PolygonBuilder.CreatePolygon(pts, SpatialReferences.WebMercator);
area = GeometryEngine.Instance.ShapePreservingArea(polygon);


polygon = PolygonBuilder.CreatePolygon(new[]
{
    MapPointBuilder.CreateMapPoint( -170, 45),
    MapPointBuilder.CreateMapPoint( 170, 45),
    MapPointBuilder.CreateMapPoint( 170, -45),
    MapPointBuilder.CreateMapPoint( -170, -54)
}, SpatialReferences.WGS84);

var area_meters = GeometryEngine.Instance.ShapePreservingArea(polygon);// , AreaUnits.SquareMeters);
var area_miles = GeometryEngine.Instance.ShapePreservingArea(polygon, AreaUnit.SquareMiles);

// area_meters - 352556425383104.37
// area_miles - 136122796.848425
Requirements

Target Platforms: Windows 11, Windows 10, Windows 8.1

See Also

Reference

GeometryEngine Class
GeometryEngine Members
Overload List