跳到主要内容

GEO_TO_H3

Returns the H3 index of the hexagon cell where the given location resides.

Syntax

GEO_TO_H3(lon, lat, res)

Arguments

ArgumentTypeDescription
lonFloat64Specifies the location's longitude, for example, 37.79506683.
latFloat64Specifies the location's latitude, for example, 55.71290588.
resUInt8Sets an H3 resolution ranging from 0 to 15.

Return Type

UInt64.

备注

Returning 0 means an error occurred.

Examples

SELECT GEO_TO_H3(37.79506683, 55.71290588, 15) AS h3Index;
+-------------------------------+
| h3Index |
+-------------------------------+
| 644325524701193974 |
+-------------------------------+