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

return the result of H3 function [gridDisk(cell, k)](https://h3geo.org/docs/api/traversal#griddisk).

K means `the distance of the origin index`, `gridDisk(cell, k)` return cells with distance `<=k` from the original cell.

`exactRing : Boolean`, when set to `true`, sedona will remove the result of `gridDisk(cell, k-1)` from the original results,
means only keep the cells with distance exactly `k` from the original cell

## Signatures

```sql theme={"system"}
ST_H3KRing(cell: Long, k: Int, exactRing: Boolean)
```

## Parameters

<ParamField body="cell" type="Long" required>
  The cell value.
</ParamField>

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

<ParamField body="exactRing" type="Boolean" required>
  The exact ring value.
</ParamField>

## Return type

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

## Example

```sql theme={"system"}
SELECT ST_H3KRing(ST_H3CellIDs(ST_GeomFromWKT('POINT(1 2)'), 8, true)[0], 1, true) cells union select ST_H3KRing(ST_H3CellIDs(ST_GeomFromWKT('POINT(1 2)'), 8, true)[0], 1, false) cells
```

```
+--------------------------------------------------------------------------------------------------------------------------------------------+
|cells                                                                                                                                       |
+--------------------------------------------------------------------------------------------------------------------------------------------+
|[614552597293957119, 614552609329512447, 614552609316929535, 614552609327415295, 614552609287569407, 614552597289762815]                    |
|[614552609325318143, 614552597293957119, 614552609329512447, 614552609316929535, 614552609327415295, 614552609287569407, 614552597289762815]|
+--------------------------------------------------------------------------------------------------------------------------------------------+
```

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