Skip to content

H3_CELL_CHILDREN

Returns a list of H3 cells representing the children of the given H3 cell at the given resolution.

Syntax

sql
H3_CELL_CHILDREN(<cell>, <target_resolution>)

Arguments

  • <cell>: A BIGINT representing the H3 cell ID.
  • <target_resolution>: An integer between 0-15 (inclusive) specifying the H3 resolution of the returned cell.

Returns

Returns a single-column table with the schema:

sql
h3_cell_children BIGINT

Each row represents a child of the given H3 cell at the given resolution.

Resolution outside a valid range results in an error. An error is also returned if the target resolution is not greater than the cell's resolution.

Note

The function requires the configuration parameter enable_full_funcscan to be set to true.

Example

sql
SELECT h3_cell_to_hexstring(h3_cell_children)
  FROM h3_cell_children(h3_point_to_cell('POINT(0 0)'::geography, 3), 4)
 ORDER BY 1;
-- 84754e1ffffffff
-- 84754e3ffffffff
-- 84754e5ffffffff
-- 84754e7ffffffff
-- 84754e9ffffffff
-- 84754ebffffffff
-- 84754edffffffff