require(["esri/geometry/operators/alphaShapeOperator"], (alphaShapeOperator) => { /* code goes here */ });
import * as alphaShapeOperator from "@arcgis/core/geometry/operators/alphaShapeOperator.js";
esri/geometry/operators/alphaShapeOperator
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.
- See also
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
execute(geometry, alpha){ExecuteResult}
-
Calculates the alpha shape on the input geometry.
Parametersgeometry GeometryThe input geometry. Only geometry vertices are used to compute the alpha shape.
alpha NumberControls 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.
ReturnsType 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);
-
Calculates the alpha shape on a set of geometries with the option to aggregate the result.
ParametersThe input geometries. Only geometry vertices are used to compute the alpha shape.
alpha NumberControls 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 ObjectoptionalAdditional options.
Specificationmerge BooleanoptionalDefault Value: falseIndicates if the alpha shape polygons should be merged. Set to
true
to merge the polygons into a single polygon.Returns
Type Definitions
-
Object returned by the executeMany() method.