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

Performs an overlay operation on a set of 2D polygons in the XY plane. This operation produces similar results to the Union tool in Geoprocessing.

Type definitions

Options

Type definition

overlaps

Property
Type
boolean | undefined

Output overlapping areas of polygons.

Default value
true

noOverlaps

Property
Type
boolean | undefined

Output non-overlapping areas of polygons.

Default value
true

gaps

Property
Type
boolean | undefined

Create polygons to fill gaps. Gaps are empty areas between different polygons, that have a closed boundary.

holes

Property
Type
boolean | undefined

Create polygons to fill holes. Holes are empty areas completely enclosed by a single polygon. In addition to regular holes formed by the interior rings, the operator considers any empty area that has a closed boundary formed by the segments of same polygon to be a hole. For example, a gap between two or more exterior rings of same polygon is also considered a hole.

multiPart

Property
Type
boolean | undefined

Output multipart polygons. Multipart output requires more processing. If the option is not set, the output will contain single part polygons (one exterior ring and zero or more holes).

ExecuteManyResult

Type definition

Object returned by the executeMany() method.

results

Property
Type
Polygon[]

The array of polygons returned by the operator.

ids

Property
Type
number[][]

The corresponding set of ids for each result. Each id is the index of the polygon in the input array. result[0] corresponds to ids[0], result[1] to ids[1], etc.

Functions

executeMany

Function

Performs the topological overlay of the geometry set in the XY plane.

Signature
executeMany (polygons: Polygon[], options?: Options): ExecuteManyResult
Parameters
ParameterTypeDescriptionRequired
polygons

The set of polygons to overlay. All the polygons must have the same spatial reference.

options

Additional options.

Returns
ExecuteManyResult

Returns the result polygons and ids. Overlaps have two or more ids, no-overlaps have one id, and gaps have no ids.

Example
// Overlay a set of polygons
const result = polygonOverlayOperator.executeMany(polygons);

Variables

supportsCurves

Variable

Indicates if the operator supports input polygons that contain curves. The value will always be true.

Type
boolean