H3_GRID_DISTANCE
functionsupportedCore SQL functionsReturns the distance between two H3 cells specified by their IDs.
Syntax
H3_GRID_DISTANCE( <cell_id_1> , <cell_id_2> )
Parameters
| Name | Required | Description |
|---|---|---|
cell_id_1 | required | An INTEGER that represents the H3 cell ID (index), or a VARCHAR that represents the cell ID in hexadecimal format. |
cell_id_2 | required | An INTEGER that represents the H3 cell ID (index), or a VARCHAR that represents the cell ID in hexadecimal format. |
Returns
Returns the INTEGER value that represents the distance in grid cells between the two H3 cells.
Usage notes
- The two input cell IDs must use the same resolution.