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

> Convert multi-coordinate LineString into an array of LineStrings that contain exactly 2 points.

Convert multi-coordinate LineString into an array of LineStrings that contain exactly 2 points.

@param geom: input LineString geometry column.
@param lenient: suppresses exception
@return: array of LineStrings

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

## Signature

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

ST_LineSegments(
    geom: ColumnOrName,
    lenient: Optional[Union[ColumnOrName, bool]] = None,
) -> Column
```

## Parameters

<ParamField path="geom" type="ColumnOrName" required />

<ParamField path="lenient" type="Optional[Union[ColumnOrName, bool]]" default="None" />


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