- Categories:
H3_ CELL_ TO_ PARENT¶
Returns the ID of the parent of an H3 cell for a given resolution. The ID is returned as an INTEGER value (if an INTEGER value was provided as the input ID) or as a VARCHAR containing the hexadecimal ID (if the hexadecimal ID was provided as the input ID).
- See also:
语法
实参
cell_idAn 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.
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。ID 采用以下格式之一:
- If
cell_idis an INTEGER value, the function returns the ID as an INTEGER value. - If
cell_idis a VARCHAR value containing the hexadecimal ID, the function returns the hexadecimal ID as a VARCHAR value.
示例
The following example returns the H3 cell ID for the parent of the H3 cell with the ID 613036919424548863 (specified as an
INTEGER value):
The following example returns the H3 cell ID for the parent of the H3 cell with the ID 881F1D4887FFFFF (specified as a
VARCHAR value):