ST_NodeLine — Returns a Line split at self intersection points, by adding nodes there.
geometry ST_NodeLine(bytea
LineString);
Returns a LineString split at self intersection points, by adding nodes there. This method supports LineString, MultiLineString or GeometryCollection geometries.
![]() | |
In 3d or 4d geometries, new vertices will have Z or M=0. |
| 2D | 3D | M |
|---|---|---|
![]() | ![]() | ![]() |
| OGC SFS for SQL. 1.1 (1999) | OGC SFS for SQL. 1.1.0 (2005) | OGC SFS for SQL. 1.2.0 (2006) | SQL-MM Part 3 |
|---|---|---|---|
| - | - | - | - |
--Ex 1
SELECT ST_AsText(ST_NodeLine(ST_GeomFromText('LINESTRING (1 1, 2 3, 2 6, 6 6, 6 2, 0 2, 0 2)')));
--Result
MULTILINESTRING ((1 1, 1.5 2), (1.5 2, 2 3, 2 6, 6 6, 6 2, 1.5 2), (1.5 2, 0 2))
--Ex 2
SELECT ST_AsText(ST_NodeLine(ST_GeomFromText('MULTILINESTRING ((2 1 5, 5 5 10),
(6 2 2, 2 4 4))')));
--Result
MULTILINESTRING ((2 1 5, 3.636363636363636 3.181818181818182 0),
(3.636363636363636 3.181818181818182 0, 5 5 10), (6 2 2, 3.636363636363636 3.181818181818182 0),
(3.636363636363636 3.181818181818182 0, 2 4 4))![]() | ![]() |
![]() | ![]() |