areaGeodetic static method
- required Geometry geometry,
- AreaUnit? unit,
- required GeodeticCurveType curveType,
Calculates the geodetic area of the given geometry using a geodetic curve.
Calculating area using a geodetic measurement accounts for the curvature of the earth's surface. Using geodetic algorithms to calculate areas and distances provides a highly accurate way to obtain measurements of geographic features, typically superior to that returned by the GeometryEngine.area method, which provides a planar measurement that can introduce distortion depending on the SpatialReference the geometry is in.
Geometry must be topologically correct to accurately calculate area. Polygons that are self-intersecting or that have inconsistent ring orientations may produce inaccurate area values. In some cases, area values for polygons with incorrect topology may be negative. Geometries returned by ArcGIS Server services are always topologically correct. To ensure that polygons constructed or modified programmatically are topologically consistent, however, it's best to simplify the input geometry using GeometryEngine.simplify before you call this method.
Supports true curves, calculating the result by densifying curves.
Parameters:
geometry
— A geometry object.unit
— The unit of measure for the return value. If null, the default unit is meters squared.curveType
— The type of curve to calculate the geodetic area.
Return Value: The calculated geodetic area in the requested unit.
Implementation
static double areaGeodetic({
required Geometry geometry,
AreaUnit? unit,
required GeodeticCurveType curveType,
}) {
_initializeArcGISEnvironmentIfNeeded();
return _withThrowingErrorHandler((errorHandler) {
return runtimecore.RT_GeometryEngine_areaGeodetic(
geometry._handle,
unit?._handle ?? ffi.nullptr,
curveType.coreValue,
errorHandler,
);
});
}