Skip to main content
Returns number of points in a LineString
If any other geometry is provided as an argument, an IllegalArgumentException is thrown.Example: SELECT ST_NumPoints(ST_GeomFromWKT('MULTIPOINT ((0 0), (1 1), (0 1), (2 2))'))Output: IllegalArgumentException: Unsupported geometry type: MultiPoint, only LineString geometry is supported.
ST_NumPoints

Signatures

ST_NumPoints(geom: Geometry)

Parameters

geom
Geometry
required
The input geometry.

Return type

An integer value.

Example

SELECT ST_NumPoints(ST_GeomFromText('LINESTRING(0 1, 1 0, 2 0)'))
3