Nota
El acceso a esta página requiere autorización. Puede intentar iniciar sesión o cambiar directorios.
El acceso a esta página requiere autorización. Puede intentar cambiar los directorios.
适用于: Databricks Runtime 17.1 及更高版本
重要
此功能目前以公共预览版提供。
返回输入 GEOGRAPHY
或 GEOMETRY
值中的非空点数。
语法
st_npoints ( geoExpr )
论据
-
geoExpr
:GEOGRAPHY
或GEOMETRY
值。
退货
类型的 INT
值,表示输入 GEOGRAPHY
或 GEOMETRY
值中非空点的数目。
如果输入为 NULL
.,则函数返回 NULL
。
例子
-- Returns the number of points in a non-empty multipoint geometry.
> SELECT st_npoints(st_geomfromtext('MULTIPOINT(10 34,44 57,EMPTY)'));
2
-- Returns the number of points in an empty multipoint geometry.
> SELECT st_npoints(st_geomfromtext('MULTIPOINT(EMPTY,EMPTY)'));
0
-- Returns the number of points in a non-empty polygon geometry.
> SELECT st_npoints(st_geomfromtext('POLYGON((0 0,1 0,1 1,0 1,0 0))'));
5