Reshape

Description

The reshape operation is performed on a geometry service resource. It reshapes a polyline or polygon feature by constructing a polyline over the feature. The feature takes the shape of the reshaper polyline from the first place the reshaper intersects the feature to the last.

At 10.1 and later, this operation calls simplify on the input target and reshaper geometries.

You can provide arguments to the reshape 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

target

Description: The polyline or polygon to be reshaped.

JSON structures:

Syntax:

{"geometryType" : "<esriGeometryPolyline | esriGeometryPolygon>""geometry" : <geometry>}

Example:

{"geometryType" : "esriGeometryPolygon","geometry" : {
  "rings" : [
   [[-117,34],[-116,34],[-117,33],[-117,34]],
   [[-115,44],[-114,43],[-115,43],[-115,44]]
  ]
 }}

reshaper

Description: The single-part polyline that does the reshaping.

JSON structures:

Syntax:

{"paths" : <polyline>}

Example:

{
  "paths" : [
   [[-116.9,33.8],[-116.9,33],[-116,33],[-116,33.8]]
  ]
 }

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

Reshape a polygon using a polyline reshaper.

http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer/reshape?sr=4326&target={"geometryType":"esriGeometryPolygon","geometry":{"rings":[[[-117,34],[-116,34],[-116,33],[-117,33],[-117,34]]]}}&reshaper={"paths":[[[-116.75,33.5],[-116.75,32.5],[-116.5,32.5],[-116.5,33.5]]]}&f=html

JSON response syntax

{"geometryType" : "<esriGeometryPolyline | esriGeometryPolygon>", "geometry" : <geometry>}

JSON response example

{
 "geometryType": "esriGeometryPolygon",
 "geometry": {
  "rings": [
   [
    [
     -116.49999999999994,
     33.000000000000057
    ],
    [
     -116.49999999999994,
     32.500000000000057
    ],
    [
     -116.74999999999994,
     32.500000000000057
    ],
    [
     -116.74999999999994,
     33.000000000000057
    ],
    [
     -116.99999999999994,
     33.000000000000057
    ],
    [
     -116.99999999999994,
     34.000000000000057
    ],
    [
     -115.99999999999994,
     34.000000000000057
    ],
    [
     -115.99999999999994,
     33.000000000000057
    ],
    [
     -116.49999999999994,
     33.000000000000057
    ]
   ]
  ]
 }
}