convexHullOperator

AMD: require(["esri/geometry/operators/convexHullOperator"], (convexHullOperator) => { /* code goes here */ });
ESM: import * as convexHullOperator from "@arcgis/core/geometry/operators/convexHullOperator.js";
Object: esri/geometry/operators/convexHullOperator
Since: ArcGIS Maps SDK for JavaScript 4.31
beta

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.

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

Method
execute(geometry){Geometry |null}

Calculates the convex hull geometry.

Parameter
geometry Geometry

The input geometry.

Returns
Type Description
Geometry | null Returns the convex hull geometry or null.
Example
// Create a convex hull around a polygon.
const convexHull = convexHullOperator.execute(polygon);

executeMany

Method
executeMany(geometries, options){Array<(Geometry|null)>}

Calculates the convex hull.

Parameters
geometries Geometry[]

The input geometries.

options Object
optional

Additional options.

Specification
merge Boolean
optional
Default Value: false

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

Returns
Type Description
Array<(Geometry|null)> Returns the convex hull geometries or null.

isConvex

Method
isConvex(geometry){Boolean}

Checks if a geometry is convex.

Parameter
geometry Geometry

The input geometry.

Returns
Type Description
Boolean Returns true if the geometry is convex.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.