All Products
Search
Document Center

PolarDB:ST_Parent

Last Updated:Mar 28, 2026

Returns the parent grid of an H3-encoded geographic grid at the specified level.

Syntax

h3grid ST_Parent(h3grid code, integer level);

Parameters

ParameterDescription
codeThe H3-encoded geographic grid object.
levelThe target level. Defaults to one level above the level of the input grid.

Examples

Get the parent grid at the default level (one level up):

SELECT ST_AsText(ST_Parent(ST_H3FromText('884a126689fffff')));

Output:

    st_astext
-----------------
 874a12668ffffff

Get the parent grid at level 2:

SELECT ST_AsText(ST_Parent(ST_H3FromText('884a126689fffff'), 2));

Output:

    st_astext
-----------------
 824a17fffffffff