Geometry service TrimExtend method

The TrimExtend method trims or extends each input polyline to meet another polyline.

TrimExtend(SpatialReference SpatialReference, Polyline[] InPolylineArray, Polyline TrimExtendTo, int ExtendHow)

Parameter

Description

SpatialReference

The SpatialReference of the geometries in the InPolygonArray. Cannot be null.

InPolylineArray

The array of polylines to be trimmed or extended.

TrimExtendTo

The defining trim/extend line.

ExtendHow

Flags controlling the extend operation.

Return Value

An array of Geometry of type polyline (Geometry[]).

Remarks

Trims (cuts) polylines that intersect the trim-extend line, or extends polylines to it that don't intersect it. See the figure below for some examples. The details of how polylines are extended can be controlled by adding together combinations of the values listed in the table below.

Constant

Value

Description

esriDefaultCurveExtension

0

By default, extension considers both ends of paths. The old ends remain and new points are added at the extended ends. The new points have attributes that are extrapolated from adjacent existing segments.

esriRelocateEnds

1

If an extension is performed at an end, relocate the end point to the new position instead of leaving the old point and adding a new point at the new position.

esriKeepEndAttributes

2

If an extension is performed at an end, do not extrapolate the end-segment's attributes for the new point. Instead, make its attributes the same as the current end. Incompatible with esriNoEndAttributes.

esriNoEndAttributes

4

If an extension is performed at an end, do not extrapolate the end-segment's attributes for the new point. Instead, make its attributes be empty. Incompatible with esriKeepEndAttributes.

esriNoExtendAtFrom

8

Do not extend the 'from' end of any path.

esriNoExtendAtTo

16

Do not extend the 'to' end of any path.

Example inputs and outputs for the trim-extend operation

Sample Trim-Extend inputs:

Vertical lines are to be trimmed/extended to the horizontal line.
The vertical lines are to be trimmed/extended to the horizontal line. The orientation of the trim-extend line is to the right.

Case 1, Sample Trim-Extend outputs:

For those inputs that are cut by the trim-extend line, the left portions are preserved. Input lines that don't intersect the trim-extend line are extended to it.
For those inputs that are cut by the trim-extend line, the left portions are preserved. Input lines that don't intersect the trim-extend line are extended to it.

Case 2, Sample Trim-Extend outputs:

Trim extend line is oriented right to left.
In this case, the trim extend line is oriented right to left.

2/28/2020