次の方法で共有


st_npoints 関数

適用対象:はい Databricks SQL チェックが Databricks Runtime 17.1 以降" とマークされているチェック

Important

この機能は パブリック プレビュー段階です

この機能は、Databricks SQL クラシック ウェアハウスでは使用できません。 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