Geometry service Reshape method

The Reshape method changes the shape of a polyline or a part of a polygon using a reshaping line.

Reshape(SpatialReference SpatialReference, Geometry Target, Polyline Reshaper)

Parameter

Description

SpatialReference

The SpatialReference of the input geometry. Cannot be null.

Target

The polyline or polygon to be reshaped.

Reshaper

The single-part polyline that does the reshaping.

Return Value

A Geometry of the same type as the target, but with portions of the reshaping line included.

Remarks

Reshapes the target polyline or polygon. The reshaping polyline can have only one part. If the Reshaper does not intersect the target polyline, or does not define a closed loop for the target polygon, then an empty geometry of the same type as the target geometry is returned. The orientation of the Reshaper is not considered. The following rules for polygon and polyline reshaping are used:

Polygons:

Only one ring (part) is explicitly reshaped - the first one in index order that intersects the reshaping path. The longest portion of the original ring boundary is preserved. The reshaped polygon is re-simplified after the reshape operation has been applied, so the rules for simplification will determine what happens if multiple rings interact with the reshaping path. The graphics show how preserving the longest portion of the boundary can invert the ring in some cases. If more complicated reshaping behavior is desired, a combination of auto-complete, cutting and union can be used.

Reshaping a polygon using a polyline.
Reshaping a polygon using a polyline.
The result polygon.
The result polygon.
Reshaping a polygon using a polyline.
Reshaping a polygon using a polyline.
The result polygon.
The result polygon.

Polylines

Multiple paths (parts) can be affected by the reshaping path. The extreme points of intersection of the reshaping path with the polyline determine the portion of the reshaping path to be included in the output. Only those points are used to modify the polyline. No other intersection points are inserted into the result.

Two examples are shown below. The circled intersection points are the only ones that will be added to the output.

Reshaping a polyline with a path that intersects the polyline in several locations.Result displays extreme intersection points relative to the reshaping path
Reshaping a polyline with a path that intersects the polyline in several locations.Result displays extreme intersection points relative to the reshaping path
Figure 1: Reshaping a polyline with a path that intersects the polyline in several locations. Only the extreme intersection points relative to the reshaping path are used in the result.

When the extreme points of intersection on the reshaping path are on two different parts, the orientation of the polyline determines which segments of those parts are included in the output. Other parts, intersecting or not, remain unaffected and are copied to the result. The next figure shows several cases. The orientation of the polyline is shown using red arrows.

Orientation of the polyline and intersection partsUnaffected part is copied to the output
Intersection partsParts preserved in the output
Intersection partsupper part is copied to output unchanged because the extreme points of intersection relative to the reshaping path are not on it
Figure 2: Several cases of reshaping a multipart polyline. The orientation of the polyline is shown with red arrows in the upper left graphic. In the first row, the unaffected part is copied to the output. In the second row, the orientation of the parts and the ordering of intersection points on the reshaping path determine which portion of the parts is preserved in the output. In the third case, the upper part is copied to output unchanged because the extreme points of intersection relative to the reshaping path are not on it.

2/28/2020