import { execute, executeMany, supportsCurves } from "@arcgis/core/geometry/operators/clipOperator.js";const { execute, executeMany, supportsCurves } = await $arcgis.import("@arcgis/core/geometry/operators/clipOperator.js");- Since
- ArcGIS Maps SDK for JavaScript 4.31
Clips geometries with a 2D extent.

Functions
| Name | Return Type | Object |
|---|---|---|
| | ||
(GeometryWithoutMeshUnion | null | undefined)[] | | |
| |
execute
Function
Perform the clip operation on the input geometry.
- Signature
-
execute (geometry: GeometryUnion, extent: Extent): GeometryWithoutMeshUnion | null | undefined
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| geometry | The geometry to be clipped. | | |
| extent | The extent used to clip the geometry. | |
- Returns
- GeometryWithoutMeshUnion | null | undefined
Returns the clipped geometry or null.
Example
// return a new geometry of a polygon clipped by the view's extentconst clippedGeometry = clipOperator.execute(polygon, view.extent); executeMany
Function
Perform the clip operation on the input geometries.
- Signature
-
executeMany (geometries: GeometryUnion[], extent: Extent): (GeometryWithoutMeshUnion | null | undefined)[]
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| geometries | The array of geometries to be clipped. All the geometries must have the same spatial reference. | | |
| extent | The extent used to clip the geometries. | |
- Returns
- (GeometryWithoutMeshUnion | null | undefined)[]
Returns an array whose elements may either be clipped geometries or null.
Variables
supportsCurves
Variable
Indicates if the operator supports input geometries that contain curves.
The value will always be true.
- Type
- boolean