Trim or Extend a Line

The operation ‘trimExtend’ allows to modify the polylines specified by the user, extending or trimming them according to the polyline also specified by the user.

The following illustrations show the result of this operation. The vertical lineal elements are to be trim/extended according to the green line horizontally arranged.

Example of request:

http://galileo.icc.cat/arcgis/rest/services/Utilities/Geometry/GeometryServer/trimExtend?sr=25831&polylines=[{"paths":[[[417500,4584975],[418200,4584975]]]}]&trimExtendTo={"paths":[[[417600,4584900],[417600,4586000]]]}&extendHow=&f=json&token=WgTR74xQdSvkHVECel6pSEijFKWafsP3g9DLA8WYg1sD3ycDBOx4g-Vj_i4xHhus

and related response:

{
 "geometryType": "esriGeometryPolyline",
 "geometries": [{"paths": [[
  [417500,4584975],[417600,4584975]
 ]]}]
}

Service parameters

Parameter

Description

f

Response format

Valid values: html | json
Default value: htm

polylines

An array of polylines to be cut or extended. The syntax of this parameter should be:

[, ]

trimExtendTo

Polyline used as reference to trim or extend previous polylines.

sr

Reference system identifier related to geometries

extendHow

Identifier that determines the result if the extend operation.

Valid values: 0 | 1 | 2 | 4 | 8 | 16.

0: the extension can be made to either end of the lines and the original end nodes are respected.
1: If the extension is done for a particular end, the original end node is removed.
2: If the extension is done for a particular end, the new segment created inherits the attributes of the original final segment.
4: If the extension is done for a particular end, the new segment will have all the attributes blank.
8: do not ever extend a line for the node leading edge (from end).
16: Do not ever extend a line through the final end node (to end).

token

Required security key in order to perform this function which is generated by filling in the corresponding form.

Additional informaton