Skip to content

ST_NPoints

Returns the number of points of the geometry.

Usage

integer ST_NPoints(geom: geometry)

Arguments

  • geom (geometry): Input geometry

Description

Returns the total number of coordinate points in the geometry, counting all vertices across all components.

Examples

SELECT ST_NPoints(
  ST_GeomFromText('LINESTRING (1 2, 3 4, 5 6)')
);
┌─────────────────────────────────────────────────────────────────┐
│ st_npoints(st_geomfromtext(Utf8("LINESTRING (1 2, 3 4, 5 6)"))) │
│                              uint64                             │
╞═════════════════════════════════════════════════════════════════╡
│                                                               3 │
└─────────────────────────────────────────────────────────────────┘