Skip to main content
Returns a LineString or MultiLineString formed by sewing together the constituent line work of a MULTILINESTRING.
Only works for MULTILINESTRING. Using other geometry will return a GEOMETRYCOLLECTION EMPTY. If no merging can be performed, the original MULTILINESTRING is returned.
ST_LineMerge

Signatures

ST_LineMerge (A: Geometry)

Parameters

A
Geometry
required
The input geometry.

Return type

The resulting geometry.

Example

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)