Returns the total number of points (vertices) in a meshgeom or sfmesh object.
Syntax
int4 ST_NPoints(meshgeom geom);
int4 ST_NPoints(sfmesh sfmesh);Parameters
| Parameter | Description |
|---|---|
geom | The meshgeom object. |
sfmesh | The sfmesh object. |
Usage notes
ST_NPoints counts every vertex declared in the VERTEX constructor. The return type is int4.
Examples
The following example counts the points in a MESHGEOM object that has four vertices.
SELECT ST_NPoints('MESHGEOM(PATCH(INDEXSURFACE(VERTEX(0 0 2,0 10 3,10 10 1,10 0 1), INDEX((0,1,2),(1,2,3)))))'::meshgeom);Output:
st_npoints
------------
4该文章对您有帮助吗?