Returns the N-th Point in a LineString. This function retrieves a specific point from the sequence based on its 1-based index.
ST_PointN(ls,N)
PointN(ls,N)Returns the N-th Point in the LineString value ls. Points are numbered beginning with 1.
ST_PointN() and PointN() are synonyms.
This page is licensed: GPLv2, originally from
SET @ls = 'LineString(1 1,2 2,3 3)';
SELECT AsText(PointN(GeomFromText(@ls),2));
+-------------------------------------+
| AsText(PointN(GeomFromText(@ls),2)) |
+-------------------------------------+
| POINT(2 2) |
+-------------------------------------+