UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

38 lines (35 loc) 1.12 kB
/** * Returns the planar area of a 2D geometry. * * ![Area operator](https://developers.arcgis.com/javascript/latest/assets/references/core/operators/area.png "Area operator") * * @since 4.31 */ import type { AreaUnit } from "../../core/units.js"; import type { GeometryUnion } from "../types.js"; export interface Options { /** * 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. */ unit?: AreaUnit; } /** * Calculates the planar area of the input geometry. * * @param geometry - The geometry to calculate the area from. * @param options - Additional options. * @returns Returns the planar area of the geometry. * @example * // Calculate the area of a polygon * const area = areaOperator.execute(polygon); */ export function execute(geometry: GeometryUnion, options?: Options): number; /** * Indicates if the operator supports input geometries that contain curves. * The value will always be `true`. * * @default true */ export const supportsCurves: boolean;