Returns the nth point in the linestring.
SELECT TREAT( Shape AS ST_LineString ).ST_PointN( 2 ) FROM SpatialShapes WHERE ShapeID = 5
The following example returns one row for each point in geom.
BEGIN DECLARE geom ST_LineString; SET geom = NEW ST_LineString( 'LineString( 0 0, 1 0 )' ); SELECT row_num, geom.ST_PointN( row_num ) FROM sa_rowgenerator( 1, geom.ST_NumPoints() ) ORDER BY row_num; END
row_num | geom.ST_PointN(row_num) |
---|---|
1 | Point (0 0) |
2 | Point (1 0) |
SQL/MM (ISO/IEC 13249-3: 2006) 7.2.5