reshapeOperator

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

Reshape 2D polygons or polylines with a single path polyline.

Method Overview

Name Return Type Summary Object

Performs the reshape operation on a polygon or polyline using a single path polyline as the reshaper.

reshapeOperator

Method Details

execute

Method
execute(geometry, reshaper){Polygon |Polyline |null}

Performs the reshape operation on a polygon or polyline using a single path polyline as the reshaper.

The output geometry takes the shape of the multipath where it first intersects the reshaper to the last intersection. The first and last intersection points of the reshaper are chosen closest to the end points of the reshaper in the case that multiple intersections are found. For polygons, only individual paths can be reshaped. However, polylines can be reshaped across paths.

Parameters
geometry Polygon|Polyline

The polygon or polyline to be reshaped.

reshaper Polyline

The single path polyline reshaper.

Returns
Type Description
Polygon | Polyline | null If the geometry is a polygon, the return type is polygon, and if the geometry is a polyline, the return type is polyline. If the geometry cannot be reshaped, then the return type is null.
Example
// Reshape a polygon geometry
const reshapedPolygon = reshapeOperator.execute(polygon, reshaperPolyline);

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