Skip to content
import { execute, executeMany, isConvex, supportsCurves } 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

Options

Type definition

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

Functions

execute

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 = convexHullOperator.execute(polygon);

executeMany

Function

Calculates the convex hull.

Signature
executeMany (geometries: GeometryUnion[], options?: Options): (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.

isConvex

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

supportsCurves

Variable

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

Type
boolean