35.49 SDO_UTIL.H3_PARENT
Format
SDO_UTIL.H3_PARENT( h3_key IN RAW, resolution IN NUMBER DEFAULT NULL ) RETURN RAW;
Description
Computes the containing H3 cell (64-bit (8 byte RAW) ) for the given cell, based on the H3 hierarchy.
Parameters
- h3_key
-
The H3 cell to query.
- resolution
-
Specifies the level for which you want the containing cell.
H3_RESOLUTION(h3_key)
must be a number. If NULL, then the immediate parent (one level coarser) is returned.
Usage Notes
Cells in the H3 hierarchy are not always strictly contained in their parent cells, and in some extreme cases, may not even touch the “containing” cell three or more levels coarser.
If you want the cell at several levels coarser resolution that most overlaps a
given cell, an alternative approach would be to compute the H3 cell of the center. For
example, SDO_UTIL.H3_KEY(SDO_UTIL.H3_CENTER(h3_key), resolution)
.
Examples
The following example shows that the parent of a level-7 cell is a level-6 cell:
SELECT SDO_UTIL.H3_RESOLUTION('0877AA5145FFFFFF') FROM DUAL;
7
SELECT SDO_UTIL.H3_PARENT('0877AA5145FFFFFF') FROM DUAL;
0867AA5147FFFFFF
SELECT SDO_UTIL.H3_RESOLUTION('0867AA5147FFFFFF') FROM DUAL;
6
Related Topics
Parent topic: SDO_UTIL Package (Utility)