SDO_UTIL.H3_KEY
Format
SDO_UTIL.H3_KEY(
longitude IN NUMBER,
latitude IN NUMBER,
resolution IN NUMBER DEFAULT 15) RETURN RAW;
SDO_UTIL.H3_KEY(
geometry IN mdsys.sdo_geometry,
resolution IN NUMBER DEFAULT 15) RETURN RAW;
Description
Returns the H3 cell for the given geodetic point and resolution.
Parameters
longitude
The longitude of the input point.
latitude
The latitude of the input point.
geometry
A geometry consisting of a single point in a geodetic coordinate system. SRID must be non-null. If it is not SRID 4326, then the point will be transformed to SRID 4326.
resolution
The resolution of the H3 cell to return, from zero (coarsest) to 15 (finest).
Usage Notes
The SDO_UTIL.H3_KEY function converts point locations to the hexagonal hierarchical spatial indexing system designed by Uber. This indexing system divides the world into 122 resolution 0 cells of 4.4 million km2 each at the top level (level 0). Cells are mapped onto an icoshedron (regular 20-sided polyhedron). Each increase in resolution subdivides into smaller cells until level 15 which has 569,707,381,193,162 cells of about 1 m2 each. The cells are hexagons except for 12 pentagons at each level (a sphere cannot be tiled with just hexagons). Note that a hexagon cannot be subdivided exactly with hexagons. As a result, cells near the border of their parent cell are not perfectly contained in their parent cell.
H3 is always computed in SRID 4326 coordinate system.
Examples
The following example shows an H3 cell in Paris:
SELECT SDO_UTIL.H3_KEY(48.85755957774311, 2.344920508484808, 7) FROM DUAL;
0877AA5145FFFFFF
The following example shows the smallest H3 cell (level 15) containing the North Pole:
SELECT SDO_UTIL.H3_KEY(SDO_GEOMETRY(2001, 4326, SDO_POINT_TYPE(0, 90, NULL), NULL, NULL), 15);
08F0326233AB0399
Related Topics