FRAMES | NO FRAMES Description | Parameters | Examples | Response
Cut (Operation)

This is an archive of a previous version of the ArcGIS REST API. The current version can be found at http://resources.arcgis.com/en/help/arcgis-rest-api/

URL http://<geometryservice-url>/cut
Parent Resource Geometry Service

Description

The cut operation is performed on a geometry service resource. This operation splits the input polyline or polygon where it crosses a cutting polyline

You can provide arguments to the cut operation as query parameters defined in the parameters table below.

Parameters

Parameter Details
f Description: The response format. The default response format is html.

Values: html | json
cutter Description: 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 same as the structure of the JSON polyline objects returned by the ArcGIS REST API.

Syntax and Examples:

JSON Structures:

Syntax:

Example:

target Description: The array of polylines/polygons to be cut. The structure of geometry is same as the structure of the json geometry objects returned by the ArcGIS REST API.

Syntax and Examples:

JSON Structures:

Syntax:
{
"geometryType" : "<esriGeometryPolyline | esriGeometryPolygon>"
"geometries" : [ <geometry1>, <geometry2> ]
}

The"target" property is a geometry of the type defined by "geometryType".

Example:
{
"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 Description: The well-known ID of the spatial reference or a spatial reference json object for the input geometry. For a list of valid WKID values, see Projected coordinate Systems and Geographic coordinate Systems.

Example Usage

Example 1: Cut a polyline geometry.

http://sampleserver3.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer/cut?sr=2229
&target={%22geometryType%22+%3A+%22esriGeometryPolyline%22%2C%22spatialReference%22+%3A{%22wkid%22+%3A+2229}%2C%22geometries%22+%3A[{%22paths%22+%3A+[[[6805743.810634688%2C1843230.507057026]%2C%0D%0A[6805740.688921779%2C1843619.888168022]%2C%0D%0A[6802621.935316771%2C1843581.5805018544]%2C[6805496.38855736%2C1844963.0199961811]]]}]}
&cutter={%22paths%22+%3A+[[[6805210%2C1843869]%2C[6805842%2C1843529]%2C[6805259%2C1843173]]]}
&f=HTML

JSON Response Syntax


The Geometry server's 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.

{
"geometryType" : "<esriGeometryPolyline | esriGeometryPolygon>",
"geometries" : [ <geometry1>, <geometry2> ],
"cutIndexes:" : [ integer1, integer2 ]
}

JSON Response Example

{
  "geometryType" : "esriGeometryPolyline", 
  
  "geometries" : 
  [
    {
      "paths" : 
      [
        [
          [6805743.81063464, 1843230.50705698], 
          [6805741.90775131, 1843467.87994181]
        ], 
        [
          [6805740.98190014, 1843583.34526207], 
          [6805740.68892172, 1843619.88816798], 
          [6805674.56471014, 1843619.07583365]
        ]
      ]
    }, 
    {
      "paths" : 
      [
        [
          [6805741.90775131, 1843467.87994181], 
          [6805740.98190014, 1843583.34526207]
        ], 
        [
          [6805674.56471014, 1843619.07583365], 
          [6802621.93531673, 1843581.58050181], 
          [6805496.3885573, 1844963.01999615]
        ]
      ]
    }
  ], 
  "cutIndexes" : [
    0, 
    0
  ]
}