This topic describes the ST_NPoints function. This function returns the number of vertexes in a geometry object. This function works for all geometry objects.

Syntax

integer  ST_NPoints(geometry  g1);

Parameters

Parameter Description
g1 The geometry object that you want to specify.

Description

This function supports circular strings, curves, polyhedral surfaces, and 3D objects.

Examples

SELECT ST_NPoints('POLYGON((0 0,0 1,1 1,0 0))'::geometry);
 st_npoints
------------
          4
(1 row)