> ## 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_S2CellIDs

Cover the geometry with Google S2 Cells, return the corresponding cell IDs with the given level.
The level indicates the [size of cells](https://s2geometry.io/resources/s2cell_statistics.html). With a bigger level,
the cells will be smaller, the coverage will be more accurate, but the result size will be exponentially increasing.

## Signatures

```sql theme={"system"}
ST_S2CellIDs(geom: Geometry, level: Integer)
```

## Parameters

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

<ParamField body="level" type="Integer" required>
  The level value.
</ParamField>

## Return type

<ResponseField type="Array<Long>">
  An integer value.
</ResponseField>

## Example

```sql theme={"system"}
SELECT ST_S2CellIDs(ST_GeomFromText('LINESTRING(1 3 4, 5 6 7)'), 6)
```

```
[1159395429071192064, 1159958379024613376, 1160521328978034688, 1161084278931456000, 1170091478186196992, 1170654428139618304]
```

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