H3_CELL_TO_PARENT

functionsupportedCore SQL functions

docs.snowflake.com ↗

Geospatial functions

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).

Syntax

H3_CELL_TO_PARENT( <cell_id> , <target_resolution> )

Parameters

NameRequiredDescription
cell_idrequiredAn INTEGER that represents the H3 cell ID (index), or a VARCHAR that represents the cell ID in hexadecimal format.
target_resolutionrequiredAn INTEGER between 0 and 15 (inclusive) specifying the H3 resolution that you want to use for the returned H3 cell. Specifying any other INTEGER value results in an error.

Returns

Returns the ID of the H3 parent cell at the specified target resolution. The ID is in one of the following formats: - If cell_id is an INTEGER value, the function returns the ID as an INTEGER value. - If cell_id is a VARCHAR value containing the hexadecimal ID, the function returns the hexadecimal ID as a VARCHAR value.

See also

Referenced by