import { convexHullExecute, execute, convexHullExecuteMany, executeMany, convexHullIsConvex } from "@arcgis/core/geometry/operators/convexHullOperator.js";
Since
ArcGIS Maps SDK for JavaScript 4.31

Calculates the convex hull of 2D geometries. A convex hull is the smallest convex polygon that encloses a group of geometries or vertices. The hull is typically a polygon but can also be a polyline or a point in degenerate cases.

Convex hull operator

Type definitions

ConvexHullOptions

Type definition
Since
ArcGIS Maps SDK for JavaScript 5.2

merge

Property
Type
boolean | undefined

Indicates if the convex hull geometries should be merged. Set to true to merge the geometries into a single geometry.

Default value
false

Options

deprecated Type definition
Supertypes
ConvexHullOptions

Functions

convexHullExecute

Function
Since
ArcGIS Maps SDK for JavaScript 5.2

Calculates the convex hull geometry.

Signature
convexHullExecute (geometry: GeometryUnion): GeometryWithoutMeshUnion | null | undefined

Parameters

ParameterTypeDescriptionRequired
geometry

The input geometry.

Returns
GeometryWithoutMeshUnion | null | undefined

Returns the convex hull geometry or null.

Example
// Create a convex hull around a polygon.
const convexHull = convexHullExecute(polygon);

execute

deprecated Function

Calculates the convex hull geometry.

Signature
execute (geometry: GeometryUnion): GeometryWithoutMeshUnion | null | undefined

Parameters

ParameterTypeDescriptionRequired
geometry

The input geometry.

Returns
GeometryWithoutMeshUnion | null | undefined

Returns the convex hull geometry or null.

Example
// Create a convex hull around a polygon.
const convexHull = convexHullExecute(polygon);

convexHullExecuteMany

Function
Since
ArcGIS Maps SDK for JavaScript 5.2

Calculates the convex hull.

Signature
convexHullExecuteMany (geometries: GeometryUnion[], options?: ConvexHullOptions): (GeometryWithoutMeshUnion | null | undefined)[]

Parameters

ParameterTypeDescriptionRequired
geometries

The input geometries. All the geometries must have the same spatial reference.

options

Additional options.

Returns
(GeometryWithoutMeshUnion | null | undefined)[]

Returns the convex hull geometries or null.

executeMany

deprecated Function

Calculates the convex hull.

Signature
executeMany (geometries: GeometryUnion[], options?: ConvexHullOptions): (GeometryWithoutMeshUnion | null | undefined)[]

Parameters

ParameterTypeDescriptionRequired
geometries

The input geometries. All the geometries must have the same spatial reference.

options

Additional options.

Returns
(GeometryWithoutMeshUnion | null | undefined)[]

Returns the convex hull geometries or null.

convexHullIsConvex

Function
Since
ArcGIS Maps SDK for JavaScript 5.2

Checks if a geometry is convex.

Signature
convexHullIsConvex (geometry: GeometryUnion): boolean

Parameters

ParameterTypeDescriptionRequired
geometry

The input geometry.

Returns
boolean

Returns true if the geometry is convex.

isConvex

deprecated Function

Checks if a geometry is convex.

Signature
isConvex (geometry: GeometryUnion): boolean

Parameters

ParameterTypeDescriptionRequired
geometry

The input geometry.

Returns
boolean

Returns true if the geometry is convex.

Variables

convexHullSupportsCurves

Variable
Since
ArcGIS Maps SDK for JavaScript 5.2

Indicates if the operator supports input geometries that contain curves. The value will always be true.

Type
boolean

supportsCurves

deprecated Variable

Indicates if the operator supports input geometries that contain curves. The value will always be true.

Type
ReturnType