FRAMES | NO FRAMES Description | Parameters | Examples | Response
Offset (Operation)
URL http://<geometryservice-url>/offset
Parent Resource Geometry Service

Description

The offset operation is performed on a geometry service resource. Offset constructs the offset of 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 it's first vertex to the last will give you a direction along the geometry. It is to the right and left perspective of this direction that the positive and negative parameters will dictate where the offset is contructed. In these terms it is simple to infer where the offset of even horizontal geometries will be constructed. The offsetHow parameter determines how outer corners between segments are handled. Rounded offset rounds the corner between extended offsets. Bevelled offset squares off the corner after a given ratio distance. Mitered offset 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.

From 10.1 onwards this operation will call Simplify on the input geometries.

You can provide arguments to the offset 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
geometries Description: 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 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 geometries property is an array of input geometries. All geometries in this array should be of the type defined by the geometryType property.

Example:
{
  "geometryType" : "esriGeometryPolyline ",
   "geometries" : [
      {
        "paths" : [ 
          [ [-97.06138,32.837], [-97.06133,32.836], [-97.06124,32.834], [-97.06127,32.832] ], 
          [ [-97.06326,32.759], [-97.06298,32.755] ]
        ],
        "spatialReference" : {"wkid" : 4326}
     } 
   ]
}
sr Description: The well-known ID or a spatial reference json object for the input geometries. For a list of valid WKID values, see Projected coordinate Systems and Geographic coordinate Systems.
offsetDistance Description : 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) Description : A unit for offset distance. If unit is not specified, the units are derived from sr. For a list of valid units, see esriSRUnitType Constants and esriSRUnit2TypeConstants.
offsetHow Description : It is one of esriGeometryOffsetMitered, esriGeometryOffsetBevelled, esriGeometryOffsetRounded.
bevelRatio Description : 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, the input bevel ratio 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.
simplifyResult Description: If true, self intersecting loops will be removed from the result offset geometries. The default is false.

Values: false | true

Example Usage

Example 1: Offset multiple polylines by 1 meter.

http://sampleserver3.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer/offset?
sr=2229
&geometries={"geometryType":"esriGeometryPolyline","spatialReference":{"wkid":2229},"geometries":[{"paths":[[[6805566.1574656013,1846311.2154481949],[6805527.5463925907,1847577.0219133438],[6805567.9057296626,1846206.4173309559],[6805566.1574656013,1846311.2154481949],[6805489.2513970956,1845286.8614968264],[6805567.9057296626,1846206.4173309559]]]},{"paths":[[[6805493.9062097641,1845121.674091635],[6805489.2513970956,1845286.8614968264],[6805496.3884592885,1844963.0200417505],[6805493.9062097641,1845121.674091635],[6805512.6586404499,1843725.7847297059],[6805496.3884592885,1844963.0200417505],[6805514.211678369,1843607.5195617655],[6805512.6586404499,1843725.7847297059],[6805523.8066700343,1842901.206113206],[6805514.211678369,1843607.5195617655],[6805532.3821443468,1842246.5626597235],[6805523.8066700343,1842901.206113206]]]}]}
&offsetDistance=1
&offsetUnit=9001
&offsetHow=esriGeometryOffsetMitered&bevelRatio=2
&simplifyResult=false
&f=html

JSON Response Syntax

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

JSON Response Example

{
  "geometryType" : "esriGeometryPolyline", 
  
  "geometries" : 
  [
    {
      "paths" : 
      [
        [
          [6805569.43677369, 1846311.31547739], 
          [6805530.62569506, 1847583.67882845], 
          [6805524.07389809, 1847583.48243998], 
          [6805564.81883934, 1846199.78272534], 
          [6805571.29520759, 1846199.93209211], 
          [6805569.3307883, 1846317.68744017], 
          [6805563.36634781, 1846317.86122269], 
          [6805562.87287955, 1846311.28844923]
        ]
      ]
    }, 
    {
      "paths" : 
      [
        [
          [6805497.18574129, 1845121.76650549], 
          [6805492.34638359, 1845293.50294242], 
          [6805485.82700549, 1845293.33924976], 
          [6805493.25276803, 1844956.39812766], 
          [6805499.7713768, 1844956.52095142], 
          [6805497.08404916, 1845128.28265713], 
          [6805490.53757939, 1845128.18747252], 
          [6805509.46623861, 1843719.18004924], 
          [6805516.02546532, 1843719.26723603], 
          [6805499.58272771, 1844969.62427911], 
          [6805493.02163891, 1844969.53800327], 
          [6805511.0173989, 1843600.91535478], 
          [6805511.01872677, 1843600.91537222], 
          [6805529.18919647, 1842239.95819138], 
          [6805535.74863772, 1842240.04494229], 
          [6805527.08722191, 1842901.24908666]
        ]
      ]
    }
  ]
}