---
title: st_numpoints function
description: Learn the syntax of the st\_numpoints function of the SQL language in Databricks SQL and Databricks Runtime.
canonical_url: https://docs.databricks.com/gcp/en/sql/language-manual/functions/st_numpoints
---

# `st_numpoints` function

**Applies to:** ![check marked yes](https://docs.databricks.com/gcp/en/images/icons/check.png) Databricks SQL ![check marked yes](https://docs.databricks.com/gcp/en/images/icons/check.png) Databricks Runtime 18.1 and above ![check marked yes](https://docs.databricks.com/gcp/en/images/icons/check.png) Lakehouse//RT

> [!NOTE]
> **Preview**
>
> Support for GEOGRAPHY values is in [Public Preview](https://docs.databricks.com/gcp/en/release-notes/release-types.md). Support for GEOMETRY values is [generally available](https://docs.databricks.com/gcp/en/release-notes/release-types.md).

> [!NOTE]
>
> This feature is not available on Databricks SQL Classic warehouses. To learn more about Databricks SQL warehouses, see [SQL warehouse types](https://docs.databricks.com/gcp/en/compute/sql-warehouse/warehouse-types.md).

Returns the number of non-empty points in the input `GEOGRAPHY` or `GEOMETRY` value.

This function is an alias for [`st_npoints` function](https://docs.databricks.com/gcp/en/sql/language-manual/functions/st_npoints.md).

## Syntax

```
st_numpoints ( geoExpr )
```

## Arguments

* `geoExpr`: A `GEOGRAPHY` or `GEOMETRY` value.

## Returns

A value of type `INT`, representing the number of non-empty points in the input `GEOGRAPHY` or `GEOMETRY` value.

The function returns `NULL` if the input is `NULL`.

## Examples

```sql
-- 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
```

## Related functions

* [`st_npoints` function](https://docs.databricks.com/gcp/en/sql/language-manual/functions/st_npoints.md)
* [`st_pointn` function](https://docs.databricks.com/gcp/en/sql/language-manual/functions/st_pointn.md)
