Comparteix via


st_npoints Función

Se aplica a:check marcado yes Databricks SQL check marcado yes Databricks Runtime 17.1 y versiones posteriores

Important

Esta característica está en versión preliminar pública.

Nota:

Esta característica no está disponible en almacenes clásicos de Databricks SQL. Para más información sobre los almacenes de SQL de Databricks, consulte Tipos de almacenamiento de SQL.

Devuelve el número de puntos no vacíos en la entrada GEOGRAPHY o en el valor GEOMETRY.

Syntax

st_npoints ( geoExpr )

Arguments

  • geoExpr: un valor de GEOGRAPHY o GEOMETRY.

Returns

Valor de tipo INT, que representa el número de puntos no vacíos en la entrada GEOGRAPHY o el valor GEOMETRY.

La función devuelve NULL si la entrada es 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