All Products
Search
Document Center

ApsaraDB RDS:ST_Parent

Last Updated:Sep 22, 2023

This topic describes the ST_Parent function. This function returns the parent grid of an H3-encoded geographic grid at the specified level.

Syntax

h3grid ST_Parent(h3grid code, integer level);

Parameters

Parameter

Description

code

The H3-encoded geographic grid object.

level

The level. The default value is the level above the level of the H3 encoded grid object.

Example

-- The upper layer by default.
select st_astext(st_parent(st_h3fromtext('884a126689fffff')));
    st_astext    
-----------------
 874a12668ffffff

-- The second layer.
select st_astext(st_parent(st_h3fromtext('884a126689fffff'),2));
    st_astext    
-----------------
 824a17fffffffff