Categories:

Geospatial functions

H3_GET_RESOLUTION

Returns the resolution of an H3 cell.

语法

H3_GET_RESOLUTION( <cell_id> )

实参

cell_id

An INTEGER that represents the H3 cell ID (index (https://h3geo.org/docs/core-library/h3Indexing)), or a VARCHAR that represents the cell ID in hexadecimal format.

返回

返回一个介于 0 和 15 之间的 INTEGER 值,该值表示 H3 输入单元格的分辨率。

示例

The following example returns the resolution of the H3 cell with the ID 617540519050084351. The example specifies the H3 cell ID as an INTEGER value.

SELECT H3_GET_RESOLUTION(617540519050084351);
+---------------------------------------+
| H3_GET_RESOLUTION(617540519050084351) |
%---------------------------------------%
|                                     9 |
+---------------------------------------+

The following example specifies the hexadecimal value of H3 cell ID (89283087033ffff) as a VARCHAR to return the resolution of the cell.

SELECT H3_GET_RESOLUTION('89283087033ffff');
+--------------------------------------+
| H3_GET_RESOLUTION('89283087033FFFF') |
%--------------------------------------%
|                                    9 |
+--------------------------------------+