require(["esri/geometry/operators/convexHullOperator"], (convexHullOperator) => { /* code goes here */ });
import * as convexHullOperator from "@arcgis/core/geometry/operators/convexHullOperator.js";
esri/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
supportsCurves Booleanreadonly
-
Indicates if the operator supports input geometries that contain curves.
- Default Value:false
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
execute(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
executeMany(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
true
to merge the geometries into a single geometry.ReturnsType Description Array<(GeometryUnion|null|undefined)> Returns the convex hull geometries or null.
-
isConvex
isConvex(geometry){Boolean}
-
Checks if a geometry is convex.
Parametergeometry GeometryUnionThe input geometry.
ReturnsType Description Boolean Returns true
if the geometry is convex.