対象:
Databricks SQL
Databricks ランタイム 18.1 以上
Lakehouse//RT
Important
GEOGRAPHY 値のサポートは パブリック プレビュー段階です。 GEOMETRY 値のサポートが 一般公開されています。
Note
この機能は、Databricks SQL クラシック ウェアハウスでは使用できません。 Databricks SQL ウェアハウスの詳細については、 SQL ウェアハウスの種類に関するページを参照してください。
入力 GEOGRAPHY または GEOMETRY 値内の空でないポイントの数を返します。
この関数は、 st_npoints 関数のエイリアスです。
構文
st_numpoints ( geoExpr )
引数
-
geoExpr:GEOGRAPHYまたはGEOMETRY値。
返品
INT型の値。入力GEOGRAPHYまたはGEOMETRY値内の空でないポイントの数を表します。
入力がNULL場合、この関数はNULLを返します。
例示
-- 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