Offset

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

Description

The offset operation is performed on a geometry service resource. This operation constructs geometries that are offset from the given input geometries. If the offset parameter is positive, the constructed offset will be on the right side of the geometry. Left-side offsets are constructed with negative parameters. Tracing the geometry from its first vertex to the last will give you a direction along the geometry. It is to the right and left perspectives of this direction that the positive and negative parameters will dictate where the offset is constructed. In these terms, you may infer where the offset of even horizontal geometries will be constructed. This operation calls simplify on the input geometries.

You can provide arguments to the offset operation as query parameters defined in the following parameters table:

Request parameters

PropertyDetails

geometries

Specifies the array of geometries to be offset. The spatial reference of the geometries is specified by sr. The structure of each geometry in the array is the same as the structure of the JSON geometry objects returned by ArcGIS REST API.

The geometries property is an array of input geometries. All geometries in this array should be of the type defined by the geometryType property.

Syntax

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

Example

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
{
  "geometryType": "esriGeometryPolyline",
  "geometries": [
    {
      "paths": [
        [[-97,32],[-96,33],[-96,32]],
        [[-80,32],[-75,35]]
      ]
    }
  ]
}

sr

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

offsetDistance

Specifies the distance for constructing an offset based on the input geometries. If the offsetDistance parameter is positive, the constructed offset will be on the right side of the curve. Left-side offsets are constructed with negative values.

offsetUnit

(Optional)

Specifies a unit for offset distance. If a unit is not specified, the units are derived from sr.

For a list of valid units, see esriSRUnitType Constants and esriSRUnit2Type Constants.

offsetHow

Determines how outer corners between segments are handled. The three options are as follows:

  • esriGeometryOffsetRounded — Rounds the corner between extended offsets.
  • esriGeometryOffsetBevelled — Squares off the corner after a given ratio distance.
  • esriGeometryOffsetMitered — Attempts to allow extended offsets to naturally intersect, but if that intersection occurs too far from the corner, the corner is eventually bevelled off at a fixed distance.

bevelRatio

(Optional)

bevelRatio is multiplied by the offset distance, and the result determines how far a mitered offset intersection can be located before it is bevelled. When mitered is specified, bevelRatio is ignored and 10 is used internally. When bevelled is specified, 1.1 will be used if bevelRatio is not specified. bevelRatio is ignored for rounded offset.

simplifyResult

(Optional)

If simplifyResult is set to true, self-intersecting loops will be removed from the result offset geometries. The default is false.

Values: true | false

f

The response format. The default format is html.

Values: html | json | pjson

Example usage

The following is a sample request URL for offset. In this example, a polyline is offset by 1,000 meters.

Use dark colors for code blocksCopy
1
https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer/offset?sr=2229&geometries={"geometryType":"esriGeometryPolyline","geometries":[{"paths":[[[0,0],[2000,2000],[3000,0]]]}]}&offsetDistance=1000&offsetHow=esriGeometryOffsetMitered&f=pjson

JSON Response syntax

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

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
{
  "geometryType": "esriGeometryPolyline",
  "geometries": [
    {
      "paths": [
        [
          [
            707.10668657907513,
            -707.10682536849038
          ],
          [
            2707.1066235769658,
            1292.8931116294002
          ],
          [
            2000.7069491716045,
            1999.2927860347611
          ],
          [
            1999.1054152581066,
            1999.5526791030704
          ],
          [
            1105.5727100790396,
            1552.7861799389339
          ],
          [
            2105.5730066568508,
            -447.2137570589565
          ]
        ]
      ]
    }
  ]
}

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