ST_Node

Name

ST_Node — Node a set of linestrings.

Synopsis

geometry ST_Node ( geometry geom ) ;

Description

Fully node a set of linestrings using the least possible number of nodes while preserving all of the input ones.

This function supports 3d and will not drop the z-index.

Availability: 2.0.0 - requires GEOS >= 3.3.0.

[Note]

Due to a bug in GEOS up to 3.3.1 this function fails to node self-intersecting lines. This is fixed with GEOS 3.3.2 or higher.

Examples

SELECT ST_AsEWKT(
		ST_Node('LINESTRINGZ(0 0 0, 10 10 10, 0 10 5, 10 0 3)'::geometry)
	) As  output;
output
-----------
MULTILINESTRING((0 0 0,5 5 4.5),(5 5 4.5,10 10 10,0 10 5,5 5 4.5),(5 5 4.5,10 0 3))