Returns the child grids of an H3-encoded geographic grid object at a specified layer.
Syntax
setof h3grid ST_Children(h3grid code, integer level);Parameters
| Parameter | Description |
|---|---|
code | The H3-encoded geographic grid object. |
level | The layer. By default, the layer above the layer at which the H3-encoded geographic grid object resides is used. |
Examples
The following example retrieves the child grids of 884a126689fffff using the default resolution:
-- By default, the layer below the layer at which the H3-encoded geographic grid object resides is used.
select st_astext(st_children(st_h3fromtext('884a126689fffff')));
st_astext
-----------------
894a1266883ffff
894a1266887ffff
894a126688bffff
894a126688fffff
894a1266893ffff
894a1266897ffff
894a126689bffffThe input grid 884a126689fffff is at resolution 8. The result contains 7 child grids at resolution 9 — each H3 hexagonal grid cell has 7 children at the next resolution level.