- Categories:
H3_ TRY_ GRID_ DISTANCE¶
A special version of H3_GRID_DISTANCE that returns NULL if an error occurs when it attempts to return the distance between two H3 cells.
Syntax¶
Arguments¶
Returns¶
Returns an INTEGER value or NULL.
- If the function can perform a successful calculation, returns the INTEGER value that represents the distance in grid cells between the two H3 cells.
- If the grid distance cannot be calculated (for example, when two cells belong to non-neighboring base cells), returns NULL without reporting an error.
Usage notes¶
See H3_GRID_DISTANCE for the usage notes.
Examples¶
The following example attempts to calculate the distance between two cells. Because the cells belong to non-neighboring base cells, the function fails to calculate the distance and returns NULL.
For examples that successfully calculate the distance between two H3 cells, see H3_GRID_DISTANCE.