ST_NPOINTS
Introduced or updated: v1.2.566
Returns the number of points in a GEOMETRY object.
Syntax
ST_NPOINTS(<geometry>)
Aliases
Arguments
Arguments | Description |
---|---|
<geometry> | The argument must be an expression of type GEOMETRY object. |
Return Type
UInt8.
Examples
SELECT ST_NPOINTS(TO_GEOMETRY('POINT(66 12)')) AS npoints
┌─────────┐
│ npoints │
├─────────┤
│ 1 │
└─────────┘
SELECT ST_NPOINTS(TO_GEOMETRY('MULTIPOINT((45 21),(12 54))')) AS npoints
┌─────────┐
│ npoints │
├─────────┤
│ 2 │
└─────────┘
SELECT ST_NPOINTS(TO_GEOMETRY('LINESTRING(40 60,50 50,60 40)')) AS npoints