- Categories:
H3_POINT_TO_CELL_STRING¶
Returns the hexadecimal value of an H3 cell ID for a Point (specified by a GEOGRAPHY object) at a given resolution.
- See also:
Syntax¶
H3_POINT_TO_CELL_STRING( <geography_point> , <target_resolution> )
Arguments¶
geography_point
A GEOGRAPHY object that represents a Point.
target_resolution
An INTEGER between 0 and 15 (inclusive) that specifies the H3 resolution (https://h3geo.org/docs/core-library/restable) that you want to use for the returned H3 cell.
Specifying any other INTEGER value results in an error.
Returns¶
Returns an VARCHAR value that corresponds to the hexadecimal H3 cell ID for the given location and resolution.
Examples¶
The following example returns the hexadecimal H3 cell ID for the Brandenburg Gate at resolution 8.
SELECT H3_POINT_TO_CELL_STRING(ST_POINT(13.377704, 52.516262), 8);
+------------------------------------------------------------+
| H3_POINT_TO_CELL_STRING(ST_POINT(13.377704, 52.516262), 8) |
|------------------------------------------------------------|
| 881F1D4887FFFFF |
+------------------------------------------------------------+
The following example demonstrates that you cannot specify a resolution outside of 0 through 15.
SELECT H3_POINT_TO_CELL_STRING(ST_POINT(13.377704, 52.516262), 18);
100410 (P0000): Invalid H3 resolution value: 18. Resolution must be between 0 (coarsest) and 15 (finest).