Skip to content
import { execute, executeMany, supportsCurves } from "@arcgis/core/geometry/operators/alphaShapeOperator.js";
Since
ArcGIS Maps SDK for JavaScript 4.31

Calculates the alpha shape of 2D points (concave hull). Alpha shapes are used to generalize bounding polygons containing sets of points or multipoints. Using this operator on other geometry types will produce results, however it is probably not what you are expecting.

Alpha shape operator

See also

Type definitions

ExecuteResult

Type definition

Object returned by the executeMany() method.

alphaShape

Property
Type
Polygon

The alpha shape polygon.

calculatedAlpha

Property
Type
number

The calculated alpha value used to generate the alpha shape.

Options

Type definition

merge

Property
Type
boolean | undefined

Indicates if the alpha shape polygons should be merged. Set to true to merge the polygons into a single polygon.

Functions

execute

Function

Calculates the alpha shape on the input geometry.

Signature
execute (geometry: GeometryUnion, alpha: number): ExecuteResult
Parameters
ParameterTypeDescriptionRequired
geometry

The input geometry. Only geometry vertices are used to compute the alpha shape.

alpha

Controls the level of detail and concavity of the boundary. The value represents the square of the alpha radius for the alpha shape. Values of 0.0 or small positive numbers will yield an empty alpha shape. A negative number or NaN will lead to the alpha shape being computed with the minimal alpha value necessary to produce a connected result.

Returns
ExecuteResult

Returns an object containing a polygon of the alpha shape and the calculated alpha value. The result polygon is not guaranteed to be simple in the sense that it may contain very short segments.

Example
// Calculate the alpha shape of a multipoint geometry
const result = alphaShapeOperator.execute(geometry, 100);

executeMany

Function

Calculates the alpha shape on a set of geometries with the option to aggregate the result.

Signature
executeMany (geometries: GeometryUnion[], alpha: number, options?: Options): (Polygon | null | undefined)[]
Parameters
ParameterTypeDescriptionRequired
geometries

The input geometries. Only geometry vertices are used to compute the alpha shape. All the geometries must have the same spatial reference.

alpha

Controls the level of detail and concavity of the boundary. The value represents the square of the alpha radius for the alpha shape. Values of 0.0 or small positive numbers will yield an empty alpha shape. A negative number or NaN will lead to the alpha shape being computed with the minimal alpha value necessary to produce a connected result.

options

Additional options.

Returns
(Polygon | null | undefined)[]

Returns the polygons of the alpha shapes or null. The result polygons are not guaranteed to be simple in the sense that they may contain very short segments.

Variables

supportsCurves

Variable

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

Type
boolean