Returns the number of points in a LineString or CircularString geometry object.
Syntax
integer ST_NumPoints(geometry g1);Parameters
| Parameter | Description |
|---|---|
g1 | The geometry object to evaluate. Must be a LineString or CircularString. |
Description
ST_NumPoints is an alias of ST_NPoints. Use ST_NPoints instead — it supports all geometry types, not just LineString and CircularString.
Example
SELECT ST_NumPoints('LineString(0 0,0 1,1 1)'::geometry);Output:
st_numpoints
--------------
3
(1 row)See also
ST_NPoints — returns the number of vertices in any geometry object, including collections and multi-part geometries.
该文章对您有帮助吗?