Partilhar via


st_npoints Função

Aplica-se a:check marked yes Databricks SQL check marked yes Databricks Runtime 17.1 e superior

Important

Este recurso está no Public Preview.

Observação

Esse recurso não está disponível nos armazéns Databricks SQL Classic. Para saber mais sobre os armazéns SQL do Databricks, consulte Tipos de armazém SQL.

Devolve o número de pontos não vazios na entrada GEOGRAPHY ou no valor GEOMETRY.

Syntax

st_npoints ( geoExpr )

Arguments

  • geoExpr: um valor GEOGRAPHY ou GEOMETRY.

Returns

Um valor do tipo INT, que representa o número de pontos não vazios na entrada GEOGRAPHY ou GEOMETRY valor.

A função retorna NULL se a entrada for 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