convexHullCollection static method
Calculates the minimum bounding geometry (convex hull) for the geometries in the given collection.
If merge is true, returns a single convex hull that encloses all the geometries in the collection as a single geometry in an array. If merge is false, returns the minimum bounding geometry that completely encloses each of the geometries in the given collection as an array of geometries. If geometries is empty, returns an empty array.
Parameters:
geometries
— A collection of geometries.merge
— True indicates that a single convex hull geometry is calculated that encloses all the geometries in the collection. False indicates that one convex hull geometry is calculated for each geometry in the collection.
Return Value: The minimum bounding geometry that completely encloses the geometries in the given collection.
Implementation
static List<Geometry> convexHullCollection({
required List<Geometry> geometries,
required bool merge,
}) {
_initializeArcGISEnvironmentIfNeeded();
final coreGeometries = geometries.toMutableArray(
valueType: _ElementType.geometry,
);
final arrayHandle = _withThrowingErrorHandler((errorHandler) {
return runtimecore.RT_GeometryEngine_convexHullCollection(
coreGeometries._handle,
merge,
errorHandler,
);
});
return arrayHandle.toList();
}