st_numpoints 函數

適用於:勾選標記為是 Databricks SQL 勾選標記為是 Databricks 執行環境 18.1 及以上版本

這很重要

地理值的支援目前已 在公開預覽階段。 一般可支援幾何值。

Note

這項功能不適用於 Databricks SQL Classic 倉儲。 若要深入瞭解 Databricks SQL 倉儲,請參閱 SQL 倉儲類型。

傳回輸入 GEOGRAPHY 或 GEOMETRY 值中非空白點的數目。

這個函式是函數的st_npoints別名。

語法

st_numpoints ( geoExpr )

引數

  • geoExpr: GEOGRAPHY 或 GEOMETRY 值。

退貨

類型的 INT值,表示輸入 GEOGRAPHY 或 GEOMETRY 值中非空白點的數目。

如果輸入為 NULL,則函式會傳NULL回 。

Examples

-- Returns the number of points in a non-empty multipoint geometry.
> SELECT st_numpoints(st_geomfromtext('MULTIPOINT(10 34,44 57,EMPTY)'));
  2
-- Returns the number of points in an empty multipoint geometry.
> SELECT st_numpoints(st_geomfromtext('MULTIPOINT(EMPTY,EMPTY)'));
  0
-- Returns the number of points in a non-empty polygon geometry.
> SELECT st_numpoints(st_geomfromtext('POLYGON((0 0,1 0,1 1,0 1,0 0))'));
  5