Geometry service Cut method
The Cut method splits input polylines or polygons where they cross a cutting polyline.
Cut(SpatialReference SpatialReference, Geometry[] Targets, Polyline Cutter, out int[] CutIndexes)
Parameter |
Description |
---|---|
SpatialReference |
The spatial reference of the input target and cutter. This cannot be null. |
Targets | |
Cutter |
The polyline that will be used to divide the targets into pieces where they cross the cutter. |
CutIndexes | An array which will be returned with indexes identifying the source geometries used to produce the output geometries. |
Return Value
An array of geometries (Geometry[]) of the same types as the targets.
Remarks
The targets of the cut operation can be a mix of polylines and polygons. For each output geometry, the corresponding element of CutIndexes contains the index value of the input geometry which was cut. An input polyline produces at most two cut outputs. An input polygon can produce two or more cut outputs.
When a polyline is cut, it is split where it intersects the cutter polyline. Each piece is classified as 'left of' or 'right of' the cutter. This classification is based on the orientation of the cutter line. Parts of the target polyline that do not intersect the cutting polyline are returned as part of the 'right of' result for that input polyline. Figure 3 shows an example. The orientation of the cutter line is indicated with a red arrowhead. Notice that a polyline part is also cut when the cutter line just touches it (as opposed to crossing it). The lower right input part is included in the `right of' result polyline. The cutting line can also have multiple parts. The left of/right of decision is made per cutting part.
Figure 2 shows an example of a cutting operation with a multipart cutting polyline. The orientation of each cutting part is shown with a red arrowhead. The 'left' result has been requested and is shown in the right box of the figure.
When the target is a polygon, the left/right classification is not done. The polygon pieces are returned as separate polygons in order of ascending area. Some of these pieces may be multipart polygons. In the figure below, the first cut part returned is to the right of the oriented cutting line, but it has the smallest area. Input parts that do not intersect the cutting line will be returned with one of the output polygons.