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

Replace Nth point of linestring with given point. Index is 0-based. Negative index are counted backwards, e.g., -1 is last point.

<img src="https://mintcdn.com/wherobots/wLm_IRUSNlHZTHJP/images/sql-functions/ST_SetPoint/ST_SetPoint.svg?fit=max&auto=format&n=wLm_IRUSNlHZTHJP&q=85&s=6b035e5245a7eea830aec0e0f3ff7c81" alt="ST_SetPoint" width="500" height="300" data-path="images/sql-functions/ST_SetPoint/ST_SetPoint.svg" />

## Signatures

```sql theme={"system"}
ST_SetPoint (linestring: Geometry, index: Integer, point: Geometry)
```

## Parameters

<ParamField body="linestring" type="Geometry" required>
  The linestring value.
</ParamField>

<ParamField body="index" type="Integer" required>
  The index value.
</ParamField>

<ParamField body="point" type="Geometry" required>
  The point value.
</ParamField>

## Return type

<ResponseField type="Geometry">
  The resulting geometry.
</ResponseField>

## Example

```sql theme={"system"}
SELECT ST_SetPoint(ST_GeomFromText('LINESTRING (0 0, 0 1, 1 1)'), 2, ST_GeomFromText('POINT (1 0)'))
```

```
LINESTRING (0 0, 0 1, 1 0)
```
