> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wherobots.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ST_NumPoints

Returns number of points in a LineString

<Note>
  If any other geometry is provided as an argument, an IllegalArgumentException is thrown.

  Example:
  `SELECT ST_NumPoints(ST_GeomFromWKT('MULTIPOINT ((0 0), (1 1), (0 1), (2 2))'))`

  Output: `IllegalArgumentException: Unsupported geometry type: MultiPoint, only LineString geometry is supported.`
</Note>

<img src="https://mintcdn.com/wherobots/wLm_IRUSNlHZTHJP/images/sql-functions/ST_NumPoints/ST_NumPoints.svg?fit=max&auto=format&n=wLm_IRUSNlHZTHJP&q=85&s=b1ede9d8157beb0b3dbd2ab6433e370c" alt="ST_NumPoints" width="500" height="300" data-path="images/sql-functions/ST_NumPoints/ST_NumPoints.svg" />

## Signatures

```sql theme={"system"}
ST_NumPoints(geom: Geometry)
```

## Parameters

<ParamField body="geom" type="Geometry" required>
  The input geometry.
</ParamField>

## Return type

<ResponseField type="Integer">
  An integer value.
</ResponseField>

## Example

```sql theme={"system"}
SELECT ST_NumPoints(ST_GeomFromText('LINESTRING(0 1, 1 0, 2 0)'))
```

```
3
```
