Returns the grid distance between two H3 grid objects.
Syntax
integer ST_GridDistance(h3grid start, h3grid end);Parameters
| Parameter | Description |
|---|---|
start | The starting H3 grid object. |
end | The ending H3 grid object. |
Return value
Returns an integer representing the distance between start and end.
Examples
The following example calculates the grid distance between two H3 grid cells derived from latitude/longitude coordinates.
SELECT ST_GridDistance(st_h3fromlatlng(25.1,123.1),st_h3fromlatlng(25.2,123.2));Output:
st_griddistance
-----------------
17096