multiPartToSinglePartOperator

AMD: require(["esri/geometry/operators/multiPartToSinglePartOperator"], (multiPartToSinglePartOperator) => { /* code goes here */ });
ESM: import * as multiPartToSinglePartOperator from "@arcgis/core/geometry/operators/multiPartToSinglePartOperator.js";
Object: esri/geometry/operators/multiPartToSinglePartOperator
Since: ArcGIS Maps SDK for JavaScript 4.31
beta

Convert multipart 2D geometries to single part geometries.

Method Overview

Name Return Type Summary Object

Performs the multipart to single part operation on the input geometries.

multiPartToSinglePartOperator

Method Details

executeMany

Method
executeMany(geometries, options){Geometry[]}

Performs the multipart to single part operation on the input geometries. Single part geometries will not be affected (i.e. they just get passed along) with the exception of multipoints, which always become points. By default, polygons will be simplified before producing single parts.

Parameters
geometries Geometry[]

The input geometries to be converted to single part geometries.

options Object
optional

Additional options.

Specification
simplifyPolygons Boolean
optional
Default Value: true

When this parameter is set to false, the input polygons will not be simplified before converting them to single part geometries. Make sure the input polygons are topologically simple. Otherwise, the operation may assume incorrect ring orientation or order of rings.

Returns
Type Description
Geometry[] Returns the single part geometries. For non-simple polygons, the output of the method is not guaranteed to be correct if the simplifyPolgons option is set to false. In that case, the method may either throw an error, or produce some output which is not guaranteed to be correct.
Example
// Convert multipart geometries to single part geometries
const singlePartGeometries = multiPartToSinglePartOperator.executeMany(multiPartGeometries);

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.

The developer dashboard has moved

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close