適用於:
Databricks SQL
Databricks Runtime 17.1 和更新版本
Important
這項功能目前處於 公開預覽版。
備註
這項功能不適用於 Databricks SQL Classic 倉儲。 若要深入瞭解 Databricks SQL 倉儲,請參閱 SQL 倉儲類型。
傳回輸入 GEOGRAPHY 或 GEOMETRY 值中非空白點的數目。
Syntax
st_npoints ( geoExpr )
Arguments
-
geoExpr:GEOGRAPHY或GEOMETRY值。
Returns
類型的 INT值,表示輸入 GEOGRAPHY 或 GEOMETRY 值中非空白點的數目。
如果輸入為 NULL,則函式會傳NULL回 。
Examples
-- 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