- Categories:
H3_ LATLNG_ TO_ CELL¶
Returns the INTEGER value of the H3 cell ID for a given latitude, longitude, and resolution.
- See also:
语法
实参
latitude表示纬度的 FLOAT。
超出标准纬度范围的值将调整到 [-90,90] 范围。
longitude表示经度的 FLOAT。
超出标准经度范围的值将调整到 [-180,180] 范围。
target_resolutionAn INTEGER between 0 and 15 (inclusive) specifying the H3 resolution (https://h3geo.org/docs/core-library/restable) that you want to use for the returned H3 cell.
指定其他任何 INTEGER 值都会导致错误。
返回
返回与给定位置和分辨率的 H3 单元格 ID 相对应的 INTEGER 值。
使用说明
- 为任何输入实参指定 NaN 或 Inf 值都会导致错误。
示例
以下示例以分辨率 8 返回勃兰登堡门的 H3 单元格 ID。
The following example specifies a longitude value (373.377704) that is outside of the traditional longitude range
(-180 to 180). The function interprets this value as 13.377704 (373.377704 modulo 180).
下面的示例演示您不能指定 0 到 15 之外的分辨率。