> ## 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_AddPoint (Python)

> Add a point to either the end of a linestring or a specified index.

Add a point to either the end of a linestring or a specified index.
If index is not provided then point will be added to the end of line\_string.

SQL reference: [`ST_AddPoint`](/reference/wherobots-db/geometry-data/editors/ST_AddPoint)

## Signature

```python theme={"system"}
from sedona.spark.sql.st_functions import ST_AddPoint

ST_AddPoint(
    line_string: ColumnOrName,
    point: ColumnOrName,
    index: Optional[Union[ColumnOrName, int]] = None,
) -> Column
```

## Parameters

<ParamField path="line_string" type="ColumnOrName" required>
  Linestring geometry column to add point to.
</ParamField>

<ParamField path="point" type="ColumnOrName" required>
  Point geometry column to add to line\_string.
</ParamField>

<ParamField path="index" type="Optional[Union[ColumnOrName, int]]" default="None">
  0-based index to insert point at in line\_string, if None then point is appended to the end of line\_string, defaults to None
</ParamField>

## Returns

<ResponseField name="return" type="Column">
  Linestring geometry column with point added.
</ResponseField>


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