Cut

URL:
https://<root>/Utilities/Geometry/GeometryServer/cut
Methods:
GET
Version Introduced:
10.0

Description

The cut operation is performed on a geometry service resource. This operation splits the target polyline or polygon where it's crossed by the cutter polyline. This operation calls simplify on the input cutter and target geometries. You can provide arguments to the cut operation as query parameters defined in the following parameters:

Request parameters

ParameterDetails

cutter

Specifies the polyline that will be used to divide the target into pieces where it crosses the target. The spatial reference of the polylines is specified by sr. The structure of the polyline is the same as the structure of the JSON polyline objects returned by the ArcGIS REST API.

Syntax

Use dark colors for code blocksCopy
1
<polyline1>

Example

Use dark colors for code blocksCopy
1
2
3
4
5
6
{
  "paths": [
    [[-117,34],[-116,34],[-117,33]],
    [[-115,44],[-114,43],[-115,43]]
  ]
}

target

Specifies the array of polylines or polygons to be cut. The structure of the geometry is the same as the structure of the JSON geometry objects returned by the ArcGIS REST API. The spatial reference of the target geometry array is specified by sr.

Syntax

Use dark colors for code blocksCopy
1
{"geometryType": "<esriGeometryPolyline | esriGeometryPolygon>","geometries": [<geometry1>, <geometry2>]}

Example

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
  "geometryType": "esriGeometryPolyline",
  "geometries": [
    {
      "paths": [
        [[-117,34],[-116,34],[-117,33]],
        [[-115,44],[-114,43],[-115,43]]
      ]
    },
    {
      "paths": [
        [[32.49,17.83],[31.96,17.59],[30.87,17.01],[30.11,16.86]]
      ]
    }
  ]
}

sr

Specifies the well-known ID (WKID) of the spatial reference or a spatial reference JSON object for the input geometry. For a list of valid WKID values, see Using spatial references.

f

The response format. The default format is html.

Values: html | json | pjson

Example usage

The following is a sample request URL for cut that demonstrates cutting a polyline geometry:

Use dark colors for code blocksCopy
1
https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer/cut?sr=2229&target={"geometryType":"esriGeometryPolyline","geometries":[{"paths":[[[6805743,1843230],[6805740,1843619]]]},{"paths":[[[6802621,1843581],[6805496,1844963]]]}]}&cutter={"paths":[[[6805210,1843869],[6805842,1843529],[6805259,1843173]]]}&f=pjson

JSON Response syntax

The geometry server's cut method returns a cutIndexes array along with an array of cut geometries. The cutIndexes array can be used to determine which of the input geometries were cut to get the resultant geometries.

Use dark colors for code blocksCopy
1
2
3
4
5
{
  "geometryType": "<esriGeometryPolyline | esriGeometryPolygon>",
  "geometries": [<geometry1>, <geometry2>, ..., <geometryN>],
  "cutIndexes:": [integer1, integer2]
}

JSON Response example

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{
  "geometryType": "esriGeometryPolyline",
  "geometries": [
    {
      "paths": [
        [
          [
            6805742.999940723,
            1843229.9998401403
          ],
          [
            6805741.168907642,
            1843467.4288272262
          ]
        ],
        [
          [
            6805740.271927804,
            1843583.727151066
          ],
          [
            6805739.999946713,
            1843619.0000463873
          ]
        ]
      ]
    },
    {
      "paths": [
        [
          [
            6805741.168907642,
            1843467.4288272262
          ],
          [
            6805740.271927804,
            1843583.727151066
          ]
        ]
      ]
    },
    {
      "paths": [
        [
          [
            6802620.999951139,
            1843581.0001223981
          ],
          [
            6805496.000106633,
            1844962.9999830574
          ]
        ]
      ]
    }
  ],
  "cutIndexes": [
    0,
    0,
    1
  ]
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.