/** * 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. * * ![Convex hull operator](https://developers.arcgis.com/javascript/latest/assets/references/core/operators/convexHull.avif "Convex hull operator") * * @since 4.31 */ import type { GeometryUnion, GeometryWithoutMeshUnion } from "../types.js"; /** @since 5.2 */ export interface ConvexHullOptions { /** * Indicates if the convex hull geometries should be merged. * Set to `true` to merge the geometries into a single geometry. * * @default false */ merge?: boolean; } /** * @deprecated * since 5.2. Refactor using \@arcgis/codemod or manually replace usages * with [ConvexHullOptions](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/convexHullOperator/#ConvexHullOptions). */ export type Options = ConvexHullOptions; /** * Calculates the convex hull geometry. * * @param geometry - The input geometry. * @returns Returns the convex hull geometry or null. * @since 5.2 * @example * // Create a convex hull around a polygon. * const convexHull = convexHullExecute(polygon); */ export function convexHullExecute(geometry: GeometryUnion): GeometryWithoutMeshUnion | null | undefined; /** * Calculates the convex hull geometry. * * @deprecated * since 5.2. Refactor using \@arcgis/codemod or manually replace usages * with [convexHullExecute()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/convexHullOperator/#convexHullExecute). * @param geometry - The input geometry. * @returns Returns the convex hull geometry or null. * @example * // Create a convex hull around a polygon. * const convexHull = convexHullExecute(polygon); */ export function execute(geometry: GeometryUnion): GeometryWithoutMeshUnion | null | undefined; /** * Calculates the convex hull. * * @param geometries - The input geometries. * All the geometries must have the same spatial reference. * @param options - Additional options. * @returns Returns the convex hull geometries or null. * @since 5.2 */ export function convexHullExecuteMany(geometries: GeometryUnion[], options?: ConvexHullOptions): (GeometryWithoutMeshUnion | null | undefined)[]; /** * Calculates the convex hull. * * @deprecated * since 5.2. Refactor using \@arcgis/codemod or manually replace usages * with [convexHullExecuteMany()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/convexHullOperator/#convexHullExecuteMany). * @param geometries - The input geometries. * All the geometries must have the same spatial reference. * @param options - Additional options. * @returns Returns the convex hull geometries or null. */ export function executeMany(geometries: GeometryUnion[], options?: ConvexHullOptions): (GeometryWithoutMeshUnion | null | undefined)[]; /** * Checks if a geometry is convex. * * @param geometry - The input geometry. * @returns Returns `true` if the geometry is convex. * @since 5.2 */ export function convexHullIsConvex(geometry: GeometryUnion): boolean; /** * Checks if a geometry is convex. * * @deprecated * since 5.2. Refactor using \@arcgis/codemod or manually replace usages * with [convexHullIsConvex()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/convexHullOperator/#convexHullIsConvex). * @param geometry - The input geometry. * @returns Returns `true` if the geometry is convex. */ export function isConvex(geometry: GeometryUnion): boolean; /** * Indicates if the operator supports input geometries that contain curves. * The value will always be `true`. * * @since 5.2 */ export const convexHullSupportsCurves: boolean; /** * Indicates if the operator supports input geometries that contain curves. * The value will always be `true`. * * @deprecated * since 5.2. Refactor using \@arcgis/codemod or manually replace usages * with [convexHullSupportsCurves](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/convexHullOperator/#convexHullSupportsCurves). */ export const supportsCurves: ReturnType;