ST_Children

更新时间:
复制 MD 格式

Returns the child grids of an H3-encoded geographic grid object at a specified resolution level.

Syntax

setof h3grid ST_Children(h3grid code, integer level);

Parameters

ParameterDescription
codeThe H3-encoded geographic grid object.
levelThe resolution level at which to return child grids. Default: one level finer than the resolution of code (that is, resolution(code) + 1).

Returns

A set of h3grid values representing the child grids of code at the specified resolution level.

Example

The following example returns the child grids of an H3 grid cell at the default resolution level (one level finer than the input).

SELECT st_astext(st_children(st_h3fromtext('884a126689fffff')));

Output:

 894a1266883ffff
 894a1266887ffff
 894a126688bffff
 894a126688fffff
 894a1266893ffff
 894a1266897ffff
 894a126689bffff

The input cell 884a126689fffff is at resolution 8. The 7 output cells are at resolution 9, one level finer.

See also

  • ST_Parent: Returns the parent grid of an H3-encoded geographic grid object.