Trim/Extend
- URL:http://<geometryservice-url>/trimExtend
- Version Introduced:10.0
Description
The trimExtend operation is performed on a geometry service resource. This operation trims or extends each polyline specified in the input array, using the user-specified guide polylines. When trimming features, the part to the left of the oriented cutting line is preserved in the output, and the other part is discarded. An empty polyline is added to the output array if the corresponding input polyline is neither cut nor extended.
You can provide arguments to the trimExtend operation as query parameters defined in the following parameters table:
Request parameters
Parameter |
Details |
---|---|
f |
Description: (Optional) The response format. The default response format is html. Values: html | json |
polylines | Description: An array of polylines to be trimmed or extended. The spatial reference of the polylines is specified by sr. The structure of each polyline in the array is the same as the structure of the JSON polyline objects returned by the ArcGIS REST API. JSON structures: Syntax:
Example:
|
trimExtendTo | Description : A polyline that is used as a guide for trimming or extending input polylines. The spatial reference of the polylines is specified by sr. The structure of each polyline is the same as the structure of the JSON polyline objects returned by the ArcGIS REST API. JSON structures: Syntax:
Example:
|
sr | Description: The well-known ID of the spatial reference or a spatial reference JSON object for the input polylines. For a list of valid WKID values, see Projected coordinate systems and Geographic coordinate systems. |
extendHow (optional) | Description: A flag that is used along with the trimExtend operation.
|
Example usage
In this example, two input polyline segments are trimmed/extended.
JSON response syntax
{
"geometryType" : "<esriGeometryPolyline>",
"geometries" : [ <geometry1>, <geometry2>, ..., <polylineN> ]
}
JSON response example
{
"geometryType": "esriGeometryPolyline",
"geometries": [
{
"paths": [
[
[
6805513.5270143142,
1843606.8529860612
],
[
6805496.0001066327,
1844962.9999830574
]
]
]
},
{
"paths": [
[
[
6805532.0000346303,
1842245.9998396486
],
[
6805513.3022866584,
1843606.7831129492
]
]
]
}
]
}