top of page
CerebroSQL

MySQL: 

ST_NUMPOINTS

ST_NumPoints(ls)

Returns the number of Point objects in the LineString value ls.

ST_NumPoints() handles its arguments as described in the introduction
to this section.

URL: https://dev.mysql.com/doc/refman/8.0/en/gis-linestring-property-functions.html

Example

mysql> SET @ls = 'LineString(1 1,2 2,3 3)';
mysql> SELECT ST_NumPoints(ST_GeomFromText(@ls));
+------------------------------------+
| ST_NumPoints(ST_GeomFromText(@ls)) |
+------------------------------------+
| 3 |
+------------------------------------+

bottom of page