import * as convexHullOperator from "@arcgis/core/geometry/operators/convexHullOperator.js";
const convexHullOperator = await $arcgis.import("@arcgis/core/geometry/operators/convexHullOperator.js");
@arcgis/core/geometry/operators/convexHullOperator
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.

Property Overview
| Name | Type | Summary | Object |
|---|---|---|---|
Indicates if the operator supports input geometries that contain curves. | convexHullOperator |
Property Details
-
supportsCurves
PropertysupportsCurves Booleanreadonly -
Indicates if the operator supports input geometries that contain curves. The value will always be
true.
Method Overview
| Name | Return Type | Summary | Object |
|---|---|---|---|
Calculates the convex hull geometry. | convexHullOperator | ||
Calculates the convex hull. | convexHullOperator | ||
Checks if a geometry is convex. | convexHullOperator |
Method Details
-
execute
Methodexecute(geometry){GeometryUnion |null |undefined} -
Calculates the convex hull geometry.
Parametergeometry GeometryUnionThe input geometry.
ReturnsType Description GeometryUnion | null | undefined Returns the convex hull geometry or null. Example// Create a convex hull around a polygon. const convexHull = convexHullOperator.execute(polygon);
-
executeMany
MethodexecuteMany(geometries, options){Array<(GeometryUnion|null|undefined)>} -
Calculates the convex hull.
Parametersgeometries GeometryUnion[]The input geometries. All the geometries must have the same spatial reference.
options ObjectoptionalAdditional options.
Specificationmerge BooleanoptionalDefault Value: falseIndicates if the convex hull geometries should be merged. Set to
trueto merge the geometries into a single geometry.ReturnsType Description Array<(GeometryUnion|null|undefined)> Returns the convex hull geometries or null.
-
isConvex
MethodisConvex(geometry){Boolean} -
Checks if a geometry is convex.
Parametergeometry GeometryUnionThe input geometry.
ReturnsType Description Boolean Returns trueif the geometry is convex.