H3_GRID_DISK
functionsupportedCore SQL functionsReturns an array of the IDs of the H3 cells that are within the specified grid distance (k_value) of the given cell. The grid distance, often written as k in the H3 model, is the number of steps between cells in the H3 grid. The IDs in the returned ARRAY are INTEGER values (if an INTEGER value was provided as the input ID) or VARCHAR values containing the hexadecimal IDs (if a hexadecimal ID was provided as the input ID).
Syntax
H3_GRID_DISK( <cell_id> , <k_value> )
Parameters
| Name | Required | Description |
|---|---|---|
cell_id | required | An INTEGER that represents the H3 cell ID (index), or a VARCHAR that represents the cell ID in hexadecimal format. |
k_value | required | An INTEGER that represents the grid distance k: the number of steps between cells in the H3 grid. You must specify a non-negative value. For example, 0 returns only the specified cell, and 1 returns that cell plus its immediate neighbors. |
Returns
Returns an ARRAY of the IDs of H3 cells that are within the distance k_value from the cell specified by cell_id. The IDs are in one of the following formats: - If cell_id is an INTEGER value, the function returns the IDs as INTEGER values. - If cell_id is a VARCHAR value containing the hexadecimal ID, the function returns the hexadecimal IDs as VARCHAR values.