> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wherobots.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ST_OffsetCurve

Returns a line at a given offset distance from a linear geometry. If the distance is positive, the offset is on the left side of the input line; if it is negative, it is on the right side. Returns null for empty geometries.

The optional third parameter `quadrantSegments` controls the number of line segments used to approximate a quarter circle at round joins. The default value is 8.

## Signatures

```sql theme={"system"}
ST_OffsetCurve(geometry: Geometry, distance: Double)
```

```sql theme={"system"}
ST_OffsetCurve(geometry: Geometry, distance: Double, quadrantSegments: Integer)
```

## Parameters

<ParamField body="geometry" type="Geometry" required>
  The linear geometry to offset.
</ParamField>

<ParamField body="distance" type="Double" required>
  The offset distance. Positive offsets to the left of the line; negative to the right.
</ParamField>

<ParamField body="quadrantSegments" type="Integer">
  The number of segments used to approximate a quarter circle at round joins. Defaults to 8.
</ParamField>

## Return type

<ResponseField type="Geometry">
  The offset line.
</ResponseField>

## Example

<img src="https://mintcdn.com/wherobots/XpQVzmvmMISOboEb/images/sql-functions/ST_OffsetCurve/ST_OffsetCurve_positive.svg?fit=max&auto=format&n=XpQVzmvmMISOboEb&q=85&s=53cef06709e0695150f5429cc4136c4a" alt="ST_OffsetCurve with a positive offset" width="500" height="300" data-path="images/sql-functions/ST_OffsetCurve/ST_OffsetCurve_positive.svg" />

```sql theme={"system"}
SELECT ST_AsText(ST_OffsetCurve(ST_GeomFromWKT('LINESTRING(0 0, 10 0, 10 10)'), 5.0))
```

```
LINESTRING (0 5, 5 5, 5 10)
```

With a negative distance (offset to the right):

<img src="https://mintcdn.com/wherobots/XpQVzmvmMISOboEb/images/sql-functions/ST_OffsetCurve/ST_OffsetCurve_negative.svg?fit=max&auto=format&n=XpQVzmvmMISOboEb&q=85&s=95a2fd2d4717c3c5e1b0c11cbcad34f3" alt="ST_OffsetCurve with a negative offset" width="500" height="300" data-path="images/sql-functions/ST_OffsetCurve/ST_OffsetCurve_negative.svg" />

```sql theme={"system"}
SELECT ST_NPoints(ST_OffsetCurve(ST_GeomFromWKT('LINESTRING(0 0, 10 0, 10 10)'), -3.0))
```

```
11
```

With `quadrantSegments` set to 16:

<img src="https://mintcdn.com/wherobots/XpQVzmvmMISOboEb/images/sql-functions/ST_OffsetCurve/ST_OffsetCurve_quadrant.svg?fit=max&auto=format&n=XpQVzmvmMISOboEb&q=85&s=b3ace12d511eabfbc4d737505c48da19" alt="ST_OffsetCurve with quadrantSegments" width="500" height="300" data-path="images/sql-functions/ST_OffsetCurve/ST_OffsetCurve_quadrant.svg" />

```sql theme={"system"}
SELECT ST_NPoints(ST_OffsetCurve(ST_GeomFromWKT('LINESTRING(0 0, 10 0, 10 10)'), -3.0, 16))
```

```
19
```
