跳转至
🎉 Apache Sedona 1.9.1 已正式发布!🗺️ 新增 Geography SQL 函数、Box2D 与 Box3D 类型、栅格 Python UDF 等。查看发布说明 →

ST_NumPoints

Introduction: Returns number of points in a LineString.

Note

If any other geometry is provided as an argument, an IllegalArgumentException is thrown. Example: SELECT ST_NumPoints(ST_GeomFromWKT('MULTIPOINT ((0 0), (1 1), (0 1), (2 2))'))

Output: IllegalArgumentException: Unsupported geometry type: MultiPoint, only LineString geometry is supported.

ST_NumPoints

Format: ST_NumPoints(geom: Geometry)

Return type: Integer

Since: v1.4.1

Example:

SELECT ST_NumPoints(ST_GeomFromText('LINESTRING(1 2, 1 3)'))

Output:

2