> ## 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

**geometry** `Geometry` *required*

The linear geometry to offset.

**distance** `Double` *required*

The offset distance. Positive offsets to the left of the line; negative to the right.

**quadrantSegments** `Integer`

The number of segments used to approximate a quarter circle at round joins. Defaults to 8.

## Return type

The offset line.

## Example

![ST\_OffsetCurve with a positive offset](https://mintcdn.com/wherobots/XpQVzmvmMISOboEb/images/sql-functions/ST_OffsetCurve/ST_OffsetCurve_positive.svg?fit=max\&auto=format\&n=XpQVzmvmMISOboEb\&q=85\&s=53cef06709e0695150f5429cc4136c4a)

```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):

![ST\_OffsetCurve with a negative offset](https://mintcdn.com/wherobots/XpQVzmvmMISOboEb/images/sql-functions/ST_OffsetCurve/ST_OffsetCurve_negative.svg?fit=max\&auto=format\&n=XpQVzmvmMISOboEb\&q=85\&s=95a2fd2d4717c3c5e1b0c11cbcad34f3)

```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:

![ST\_OffsetCurve with quadrantSegments](https://mintcdn.com/wherobots/XpQVzmvmMISOboEb/images/sql-functions/ST_OffsetCurve/ST_OffsetCurve_quadrant.svg?fit=max\&auto=format\&n=XpQVzmvmMISOboEb\&q=85\&s=b3ace12d511eabfbc4d737505c48da19)

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

```
19
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.