Skip to content
import { isLoaded, load, execute, supportsCurves } from "@arcgis/core/geometry/operators/geodeticAreaOperator.js";
Since
ArcGIS Maps SDK for JavaScript 4.31

Returns the geodetic area of a 2D geometry.

Notes

Verify that isLoaded() returns true before using this module. Use load() to load this module's dependencies.

Type definitions

Options

Type definition

curveType

Property
Type
GeodeticCurveType | undefined

The type of geodetic curve used to determine the area.

Default value
"geodesic"

unit

Property
Type
AreaUnit | undefined

The area unit of the return value.

Default value
"square-meters"

Functions

isLoaded

Function

Indicates if all dependencies of this module have been loaded.

Signature
isLoaded (): boolean
Returns
boolean

Returns true if this module's dependencies have been loaded.

load

Function

Loads this module's dependencies. This method must be called first if isLoaded returns false.

See also
Signature
load (): Promise<void>
Returns
Promise<void>

Resolves when the dependencies have been loaded.

execute

Function

Calculates the geodetic area of the input Geometry. Unless the unit option is set, the default is square-meters.

Signature
execute (geometry: GeometryUnion, options?: Options): number
Parameters
ParameterTypeDescriptionRequired
geometry

The input geometry.

options

Additional options.

Returns
number

Returns the geodetic area of the input geometry.

Example
if (!geodeticAreaOperator.isLoaded()) {
await geodeticAreaOperator.load();
}
// Calculate the geodetic area of a polygon.
const area = geodeticAreaOperator.execute(polygon);

Variables

supportsCurves

Variable

Indicates if the operator supports input geometries that contain curves. The value is null or undefined until the operator is loaded, then it will always be true.

Type
boolean | null | undefined