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

Returns a LineString or MultiLineString formed by sewing together the constituent line work of a MULTILINESTRING.

<Note>
  Only works for MULTILINESTRING. Using other geometry will return a GEOMETRYCOLLECTION EMPTY. If no merging can be performed, the original MULTILINESTRING is returned.
</Note>

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

## Signatures

```sql theme={"system"}
ST_LineMerge (A: Geometry)
```

## Parameters

<ParamField body="A" type="Geometry" required>
  The input geometry.
</ParamField>

## Return type

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

## Example

```sql theme={"system"}
SELECT ST_LineMerge(ST_GeomFromWKT('MULTILINESTRING ((-29 -27, -30 -29.7, -45 -33), (-45 -33, -46 -32))'))
```

```
LINESTRING (-29 -27, -30 -29.7, -45 -33, -46 -32)
```
