ST_LineMerge¶
Introduction: 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.
Format: ST_LineMerge (A: Geometry)
Since: v1.0.0
SQL Example
SELECT ST_LineMerge(ST_GeomFromWKT('MULTILINESTRING ((-29 -27, -30 -29.7, -45 -33), (-45 -33, -46 -32))'))
Output:
LINESTRING (-29 -27, -30 -29.7, -45 -33, -46 -32)