Skip to content

ST_LineMerge

Merges a collection of potentially connected line segments into the fewest possible LineStrings.

Usage

geometry ST_LineMerge(geom: geometry)

Arguments

  • geom (geometry): Input geometry

Examples

SELECT ST_LineMerge(
    ST_GeomFromWKT('MULTILINESTRING ((0 0, 1 0), (1 0, 1 1))')
);
┌──────────────────────────────────────────────────────────────────────────────┐
│ st_linemerge(st_geomfromwkt(Utf8("MULTILINESTRING ((0 0, 1 0), (1 0, 1 1))") │
│                                      ))…                                     │
╞══════════════════════════════════════════════════════════════════════════════╡
│ LINESTRING(0 0,1 0,1 1)                                                      │
└──────────────────────────────────────────────────────────────────────────────┘