Skip To Content

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

ParameterDetails
target

Specifies the polyline or polygon to be reshaped.

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

Specifies the single-part polyline that does the reshaping.

Syntax

{"paths": <polyline>}

Example


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

Specifies 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 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 reshape that demonstrates how to reshape a polygon using a polyline reshaper:

https://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
        ]
      ]
    ]
  }
}