Skip to content
import { execute, executeMany, supportsCurves } from "@arcgis/core/geometry/operators/clipOperator.js";
Since
ArcGIS Maps SDK for JavaScript 4.31

Clips geometries with a 2D extent.

Clip operator

Functions

execute

Function

Perform the clip operation on the input geometry.

Signature
execute (geometry: GeometryUnion, extent: Extent): GeometryWithoutMeshUnion | null | undefined
Parameters
ParameterTypeDescriptionRequired
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 extent
const 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
ParameterTypeDescriptionRequired
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