ST_H3ToChildren¶
Introduction: Returns the children of an H3 cell at the requested resolution using H3's cellToChildren(cell, resolution).
The requested resolution must be between the input cell's resolution and 15, inclusive. An equal resolution returns an array containing only the input cell. A lower resolution or a resolution outside this range raises an error. A null cell or resolution returns null.
The result contains the cell's descendants in the H3 hierarchy. An immediate hexagon parent has seven children, while an immediate pentagon parent has six. The order of the returned cells is not guaranteed.
Format: ST_H3ToChildren(cell: Long, resolution: Int)
Return type: Array<Long>
Since: v2.0.0
SQL Example
SELECT ST_H3ToChildren(601041811137363967, 5)
Output:
[601041811137363967]
To count the immediate children of this resolution 5 hexagon:
SELECT SIZE(ST_H3ToChildren(601041811137363967, 6)) AS child_count
Output:
7