areaOperator

ESM: import * as areaOperator from "@arcgis/core/geometry/operators/areaOperator.js";
CDN: const areaOperator = await $arcgis.import("@arcgis/core/geometry/operators/areaOperator.js");
Object: @arcgis/core/geometry/operators/areaOperator
Since: ArcGIS Maps SDK for JavaScript 4.31

Returns the planar area of a 2D geometry.

Area operator

Property Overview

Name Type Summary Object

Indicates if the operator supports input geometries that contain curves.

areaOperator

Property Details

supportsCurves

Property
supportsCurves Booleanreadonly

Indicates if the operator supports input geometries that contain curves.

Default Value:true

Method Overview

Name Return Type Summary Object

Calculates the planar area of the input geometry.

areaOperator

Method Details

execute

Method
execute(geometry, options){Number}

Calculates the planar area of the input geometry.

Parameters
geometry GeometryUnion

The geometry to calculate the area from.

options Object
optional

Additional options.

Specification
unit AreaUnit
optional

The area unit of the return value. The default is the input geometry's spatial reference unit. An error will be thrown if this is set for Geographic Coordinate Systems.

Returns
Type Description
Number Returns the planar area of the geometry.
Example
// Calculate the area of a polygon
const area = areaOperator.execute(polygon);

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.