alphaShapeOperator

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

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.

Method Overview

Name Return Type Summary Object

Calculates the alpha shape on the input geometry.

alphaShapeOperator

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

alphaShapeOperator

Method Details

execute

Method
execute(geometry, alpha){ExecuteResult}

Calculates the alpha shape on the input geometry.

Parameters
geometry Geometry

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

alpha Number

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
Type Description
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

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

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

Parameters
geometries Geometry[]

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

alpha Number

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 Object
optional

Additional options.

Specification
merge Boolean
optional
Default Value: false

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

Returns
Type Description
Array<(Polygon|null)> 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.

Type Definitions

ExecuteResult

Type Definition
ExecuteResult

Object returned by the executeMany() method.

Properties
alphaShape Polygon

The alpha shape polygon.

calculatedAlpha Number

The calculated alpha value used to generate the alpha shape.

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