Returns the count of Points in a LineString. This function calculates the total number of vertices defining the line.
ST_NumPoints(ls)
NumPoints(ls)Returns the number of Point objects in the LineString value ls.
ST_NumPoints() and NumPoints() are synonyms.
This page is licensed: GPLv2, originally from
SET @ls = 'LineString(1 1,2 2,3 3)';
SELECT NumPoints(GeomFromText(@ls));
+------------------------------+
| NumPoints(GeomFromText(@ls)) |
+------------------------------+
| 3 |
+------------------------------+