Condividi tramite


Funzione st_numpoints

Si applica a:check contrassegnato come sì Databricks Runtime 18.1 e versioni successive

Importante

Questa funzionalità è in Anteprima Pubblica.

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

Questa funzione è un alias per st_npoints la funzione.

Sintassi

st_numpoints ( geoExpr )

Arguments

  • geoExpr: un valore GEOGRAPHY o GEOMETRY.

Restituzioni

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_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