Condividi tramite


Funzione st_npoints

Si applica a:check contrassegnato come sì controllo SQL di Databricks contrassegnato come sì Databricks Runtime 17.1 e versioni successive

Important

Questa funzionalità è in Anteprima Pubblica.

Annotazioni

Questa funzionalità non è disponibile in Databricks SQL Classic Warehouses. Per altre informazioni sui databricks SQL Warehouse, vedere Tipi di SQL Warehouse.

Restituisce il numero di punti non vuoti nei valori di input GEOGRAPHY o GEOMETRY.

Syntax

st_npoints ( geoExpr )

Arguments

  • geoExpr: un valore GEOGRAPHY o GEOMETRY.

Returns

Un valore di tipo INT, che rappresenta il numero di punti non vuoti nel valore di input GEOGRAPHY o GEOMETRY.

La funzione restituisce NULL se l'input è 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