ST_NumPoints takes a linestring and returns its number of points.
Syntax
db2gse.ST_NumPoints(l db2gse.ST_LineString)
Return type
Integer
Examples
The following CREATE TABLE statement creates the NUMPOINTS_TEST table. The GEOTYPE column contains the geometry type stored in the G1 geometry column.
CREATE TABLE NUMPOINTS_TEST (geotype varchar(12), g1 db2gse.ST_Geometry)
The following INSERT statement inserts a linestring.
INSERT INTO NUMPOINTS_TEST VALUES( linestring, db2gse.ST_LineFromText('linestring (10.02 20.01, 23.73 21.92)', db2gse.coordref()..srid(0)))
The following SELECT statement and the corresponding result set lists the geometry type and the number of points contained within each.
SELECT geotype, db2gse.ST_NumPoints(g1) FROM NUMPOINTS_TEST GEOTYPE Number of points ------------ ---------------- ST_linestring 2 1 record(s) selected.