﻿---
title: ES|QL ST_NPOINTS function
description: 
url: https://www.elastic.co/elastic/docs-builder/docs/2948/reference/query-languages/esql/functions-operators/spatial-functions/st_npoints
products:
  - Elasticsearch
---

# ES|QL ST_NPOINTS function
<applies-to>
  - Elastic Cloud Serverless: Preview
  - Elastic Stack: Planned
</applies-to>


## Syntax

![Embedded](https://www.elastic.co/elastic/docs-builder/docs/2948/reference/query-languages/esql/images/functions/st_npoints.svg)


## Parameters

<definitions>
  <definition term="geometry">
    Expression of type `geo_point`, `geo_shape`, `cartesian_point` or `cartesian_shape`. If `null`, the function returns `null`.
  </definition>
</definitions>


## Description

Counts the number of points in the supplied geometry.

## Supported types


| geometry        | result  |
|-----------------|---------|
| cartesian_point | integer |
| cartesian_shape | integer |
| geo_point       | integer |
| geo_shape       | integer |


## Example

```esql
FROM airport_city_boundaries
| WHERE abbrev == "CPH"
| EVAL points = ST_NPOINTS(city_boundary)
| KEEP abbrev, airport, points
```


| abbrev:keyword | airport:text | points:integer |
|----------------|--------------|----------------|
| CPH            | Copenhagen   | 15             |