﻿ Offset Method (GeometryEngine)—ArcGIS Pro
ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.Geometry Namespace / GeometryEngine Class / Offset Method
The geometry to calculate offset for. MapPoint and Multipoint are not supported.
The offset distance for the geometry.
The offset type of the offset geometry.
The ratio used to produce a bevel join instead of a miter join (used only when offsetType is miter).
Example

In This Topic
Offset Method (GeometryEngine)
In This Topic
Constructs the offset version of the input geometry. The offset operation creates a geometry that is a constant distance from an input polyline or polygon. It is similar to buffering, but produces a one sided result. If offset distance > 0, then the offset geometry is constructed to the right of the oriented input geometry, otherwise it is constructed to the left. For a simple polygon, the orientation of outer rings is clockwise and for inner rings it is counter clockwise. So the "right side" of a simple polygon is always its inside. The bevelRatio is multiplied by the offset distance and the result determines how far a mitered offset intersection can be from the input curve before it is beveled.
Syntax
```public Geometry Offset(
Geometry geometry,
double distance,
OffsetType offsetType,
double bevelRatio
)```
```Public Function Offset( _
ByVal geometry As Geometry, _
ByVal distance As Double, _
ByVal offsetType As OffsetType, _
ByVal bevelRatio As Double _
) As Geometry```

#### Parameters

geometry
The geometry to calculate offset for. MapPoint and Multipoint are not supported.
distance
The offset distance for the geometry.
offsetType
The offset type of the offset geometry.
bevelRatio
The ratio used to produce a bevel join instead of a miter join (used only when offsetType is miter).

#### Return Value

The offset geometry. If the input geometry is empty, then it is returned unchanged.
Exceptions
ExceptionDescription
Geometry is null.
The method is not implemented for GeometryBag or Multipatch.
MapPoint and Multipoint geometry types are not supported.
Remarks

Example
Calculate a geometry offset from the source
```List<MapPoint> linePts = new List<MapPoint>();

Polyline polyline = PolylineBuilderEx.CreatePolyline(linePts);

Geometry g = GeometryEngine.Instance.Offset(polyline, 10, OffsetType.Square, 0);
Polyline gResult = g as Polyline;
// gResult.PointCount = 2
// gResult.Points[0] = (1, -9)
// gResult.Points[1] = (10, -9)

g = GeometryEngine.Instance.Offset(polyline, -10, OffsetType.Round, 0.5);
gResult = g as Polyline;
// gResult.PointCount = 2
// gResult.Points[0] = (1, -11
// gResult.Points[1] = (10, 11)

//
// elliptic arc curve
//
Coordinate2D fromPt = new Coordinate2D(2, 1);
Coordinate2D toPt = new Coordinate2D(1, 2);
Coordinate2D interiorPt = new Coordinate2D(1 + Math.Sqrt(2) / 2, 1 + Math.Sqrt(2) / 2);

EllipticArcSegment circularArc = EllipticArcBuilderEx.CreateCircularArc(fromPt.ToMapPoint(), toPt.ToMapPoint(), interiorPt);

polyline = PolylineBuilderEx.CreatePolyline(circularArc);
g = GeometryEngine.Instance.Offset(polyline, -0.25, OffsetType.Miter, 0.5);
gResult = g as Polyline;

g = GeometryEngine.Instance.Offset(polyline, 0.25, OffsetType.Bevel, 0.5);
gResult = g as Polyline;

//
//  offset for a polygon
//
List<MapPoint> list = new List<MapPoint>();

Polygon polygon = PolygonBuilderEx.CreatePolygon(list);

g = GeometryEngine.Instance.Offset(polygon, 2, OffsetType.Square, 0);
Polygon gPolygon = g as Polygon;

g = GeometryEngine.Instance.Offset(polygon, -2, OffsetType.Round, 0.3);
gPolygon = g as Polygon;

g = GeometryEngine.Instance.Offset(polygon, -0.5, OffsetType.Miter, 0.6);
gPolygon = g as Polygon;
```
Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3 or higher.