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 | |
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.
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.
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.