ST_NUMPOINTS
functionsupportedCore SQL functionsReturns the number of points in a GEOGRAPHY or GEOGRAPHY object.
Syntax
ST_NPOINTS( <geography_or_geometry_expression> )
Parameters
| Name | Required | Description |
|---|---|---|
geography_or_geometry_expression | required | The argument must be an expression of type GEOGRAPHY or GEOMETRY. |
Returns
Returns a value of type INTEGER.
Usage notes
- Each Polygon loop lists the starting point twice (once as the start, once as the end). ST_NPOINTS counts both occurrences. For example, given a triangular Polygon, ST_NPOINTS returns 4, not 3.
- ST_NUMPOINTS is an alias for ST_NPOINTS. Note In some other systems, ST_NUMPOINTS behaves differently from ST_NPOINTS and returns the number of points for LineString / MultiLineString objects only.