OmniSciDB
a5dc49c757
|
H3Index functions. More...
#include "QueryEngine/ExtensionFunctions/h3lib/include/faceijk.h"
#include "QueryEngine/ExtensionFunctions/h3lib/include/h3api.h"
#include "QueryEngine/ExtensionFunctions/h3lib/lib/h3Index.hpp"
Go to the source code of this file.
Functions | |
EXTENSION_NOINLINE H3Index | _faceIjkToH3 (const FaceIJK(fijk), int res) |
EXTENSION_INLINE int | _h3LeadingNonZeroDigit (H3Index h) |
EXTENSION_NOINLINE H3Index | _h3RotatePent60ccw (H3Index h) |
EXTENSION_NOINLINE H3Index | _h3RotatePent60cw (H3Index h) |
EXTENSION_NOINLINE H3Index | _h3Rotate60ccw (H3Index h) |
EXTENSION_NOINLINE H3Index | _h3Rotate60cw (H3Index h) |
EXTENSION_NOINLINE int | _h3ToFaceIjkWithInitializedFijk (H3Index h, FaceIJK(fijk)) |
EXTENSION_NOINLINE bool | _h3ToFaceIjk (H3Index h, FaceIJK(fijk)) |
EXTENSION_NOINLINE bool | _h3ToGeo (H3Index h3, GeoCoord(g)) |
H3Index functions.
Definition in file h3Index.h.
#define H3_BC_MASK ((uint64_t)(127) << H3_BC_OFFSET) |
#define H3_BC_MASK_NEGATIVE (~H3_BC_MASK) |
#define H3_BC_OFFSET 45 |
#define H3_DIGIT_MASK ((uint64_t)(7)) |
1's in the 3 bits of res 15 digit bits, 0's everywhere else.
Definition at line 80 of file h3Index.h.
Referenced by h3ToParent().
#define H3_DIGIT_MASK_NEGATIVE (~H3_DIGIT_MASK) |
#define H3_GET_BASE_CELL | ( | h3 | ) | ((int)((((h3)&H3_BC_MASK) >> H3_BC_OFFSET))) |
Gets the integer base cell of h3.
Definition at line 117 of file h3Index.h.
Referenced by _h3ToFaceIjk(), and _h3ToFaceIjkWithInitializedFijk().
#define H3_GET_HIGH_BIT | ( | h3 | ) | ((int)((((h3)&H3_HIGH_BIT_MASK) >> H3_MAX_OFFSET))) |
#define H3_GET_INDEX_DIGIT | ( | h3, | |
res | |||
) | ((Direction)((((h3) >> ((MAX_H3_RES - (res)) * H3_PER_DIGIT_OFFSET)) & H3_DIGIT_MASK))) |
Gets the resolution res integer digit (0-7) of h3.
Definition at line 139 of file h3Index.h.
Referenced by _h3LeadingNonZeroDigit(), _h3Rotate60ccw(), _h3Rotate60cw(), _h3RotatePent60ccw(), _h3RotatePent60cw(), and _h3ToFaceIjkWithInitializedFijk().
#define H3_GET_MODE | ( | h3 | ) | ((int)((((h3)&H3_MODE_MASK) >> H3_MODE_OFFSET))) |
#define H3_GET_RESERVED_BITS | ( | h3 | ) | ((int)((((h3)&H3_RESERVED_MASK) >> H3_RESERVED_OFFSET))) |
#define H3_GET_RESOLUTION | ( | h3 | ) | ((int)((((h3)&H3_RES_MASK) >> H3_RES_OFFSET))) |
Gets the integer resolution of h3.
Definition at line 128 of file h3Index.h.
Referenced by _h3LeadingNonZeroDigit(), _h3Rotate60ccw(), _h3Rotate60cw(), _h3RotatePent60ccw(), _h3RotatePent60cw(), _h3ToFaceIjk(), _h3ToFaceIjkWithInitializedFijk(), _h3ToGeo(), and h3ToParent().
#define H3_HIGH_BIT_MASK ((uint64_t)(1) << H3_MAX_OFFSET) |
#define H3_HIGH_BIT_MASK_NEGATIVE (~H3_HIGH_BIT_MASK) |
#define H3_INIT (UINT64_C(35184372088831)) |
H3 index with mode 0, res 0, base cell 0, and 7 for all index digits. Typically used to initialize the creation of an H3 cell index, which expects all direction digits to be 7 beyond the cell's resolution.
Definition at line 90 of file h3Index.h.
Referenced by _faceIjkToH3().
#define H3_MAX_OFFSET 63 |
#define H3_MODE_MASK ((uint64_t)(15) << H3_MODE_OFFSET) |
#define H3_MODE_MASK_NEGATIVE (~H3_MODE_MASK) |
#define H3_MODE_OFFSET 59 |
#define H3_NULL 0 |
Invalid index used to indicate an error from geoToH3 and related functions or missing data in arrays of h3 indices. Analogous to NaN in floating point.
Definition at line 165 of file h3Index.h.
Referenced by _faceIjkToH3(), geoToH3(), and h3ToParent().
#define H3_PER_DIGIT_OFFSET 3 |
#define H3_RES_MASK (UINT64_C(15) << H3_RES_OFFSET) |
#define H3_RES_MASK_NEGATIVE (~H3_RES_MASK) |
#define H3_RES_OFFSET 52 |
#define H3_RESERVED_MASK ((uint64_t)(7) << H3_RESERVED_OFFSET) |
#define H3_RESERVED_MASK_NEGATIVE (~H3_RESERVED_MASK) |
#define H3_RESERVED_OFFSET 56 |
#define H3_SET_BASE_CELL | ( | h3, | |
bc | |||
) | (h3) = (((h3)&H3_BC_MASK_NEGATIVE) | (((uint64_t)(bc)) << H3_BC_OFFSET)) |
Sets the integer base cell of h3 to bc.
Definition at line 122 of file h3Index.h.
Referenced by _faceIjkToH3().
#define H3_SET_HIGH_BIT | ( | h3, | |
v | |||
) | (h3) = (((h3)&H3_HIGH_BIT_MASK_NEGATIVE) | (((uint64_t)(v)) << H3_MAX_OFFSET)) |
#define H3_SET_INDEX_DIGIT | ( | h3, | |
res, | |||
digit | |||
) |
Sets the resolution res digit of h3 to the integer digit (0-7)
Definition at line 157 of file h3Index.h.
Referenced by _faceIjkToH3(), _h3Rotate60ccw(), _h3Rotate60cw(), _h3RotatePent60ccw(), _h3RotatePent60cw(), and h3ToParent().
#define H3_SET_MODE | ( | h3, | |
v | |||
) | (h3) = (((h3)&H3_MODE_MASK_NEGATIVE) | (((uint64_t)(v)) << H3_MODE_OFFSET)) |
Sets the integer mode of h3 to v.
Definition at line 111 of file h3Index.h.
Referenced by _faceIjkToH3().
#define H3_SET_RESERVED_BITS | ( | h3, | |
v | |||
) | (h3) = (((h3)&H3_RESERVED_MASK_NEGATIVE) | (((uint64_t)(v)) << H3_RESERVED_OFFSET)) |
#define H3_SET_RESOLUTION | ( | h3, | |
res | |||
) | (h3) = (((h3)&H3_RES_MASK_NEGATIVE) | (((uint64_t)(res)) << H3_RES_OFFSET)) |
Sets the integer resolution of h3.
Definition at line 133 of file h3Index.h.
Referenced by _faceIjkToH3(), and h3ToParent().
EXTENSION_NOINLINE H3Index _faceIjkToH3 | ( | const | FaceIJKfijk, |
int | res | ||
) |
Convert an FaceIJK address to the corresponding H3Index.
fijk | The FaceIJK address. |
res | The cell resolution. |
Definition at line 643 of file h3Index.hpp.
References _baseCellIsCwOffset(), _downAp7(), _downAp7r(), _faceIjkToBaseCell(), _faceIjkToBaseCellCCWrot60(), _h3LeadingNonZeroDigit(), _h3Rotate60ccw(), _h3Rotate60cw(), _h3RotatePent60ccw(), _ijkNormalize(), _ijkSub(), _isBaseCellPentagon(), _unitIjkToDigit(), _upAp7(), _upAp7r(), CoordIJK, CoordIJK_clone, CoordIJK_copy, CoordIJK_ptr, FACE_INDEX, FaceIJK, FaceIJK_clone, H3_HEXAGON_MODE, H3_INIT, H3_NULL, H3_SET_BASE_CELL, H3_SET_INDEX_DIGIT, H3_SET_MODE, H3_SET_RESOLUTION, H3Index, I_INDEX, isResClassIII(), J_INDEX, K_AXES_DIGIT, K_INDEX, and MAX_FACE_COORD.
Referenced by geoToH3().
EXTENSION_INLINE int _h3LeadingNonZeroDigit | ( | H3Index | h | ) |
Determines whether one resolution is a valid child resolution of another. Each resolution is considered a valid child resolution of itself.
parentRes | int resolution of the parent |
childRes | int resolution of the child |
h | H3Index to find the number of children of |
childRes | The resolution of the child level you're interested in |
h | H3Index to find the direct child of |
cellNumber | int id of the direct child (0-6) |
h | H3Index to find the children of |
childRes | int the child level to produce |
children | H3Index* the memory to store the resulting addresses in h3ToCenterChild produces the center child index for a given H3 index at the specified resolution |
h | H3Index to find center child of |
childRes | The resolution to switch to |
h3Set | Set of hexagons |
compactedSet | The output array of compressed hexagons (preallocated) |
numHexes | The size of the input and output arrays (possible that no contiguous regions exist in the set at all and no compression possible) |
compactedSet | Set of hexagons |
numHexes | The number of hexes in the input set |
h3Set | Output array of decompressed hexagons (preallocated) |
maxHexes | The size of the output array to bound check against |
res | The hexagon resolution to decompress to |
compactedSet | Set of hexagons |
numHexes | The number of hexes in the input set |
res | The hexagon resolution to decompress to |
h | The H3Index to check. |
h | The H3Index to check. |
h | The H3Index. |
Definition at line 551 of file h3Index.hpp.
References CENTER_DIGIT, H3_GET_INDEX_DIGIT, and H3_GET_RESOLUTION.
Referenced by _faceIjkToH3(), _h3RotatePent60ccw(), _h3RotatePent60cw(), and _h3ToFaceIjk().
EXTENSION_NOINLINE H3Index _h3Rotate60ccw | ( | H3Index | h | ) |
Rotate an H3Index 60 degrees counter-clockwise.
h | The H3Index. |
Definition at line 616 of file h3Index.hpp.
References _rotate60ccw(), H3_GET_INDEX_DIGIT, H3_GET_RESOLUTION, H3_SET_INDEX_DIGIT, and run_benchmark_import::res.
Referenced by _faceIjkToH3(), and _h3RotatePent60ccw().
EXTENSION_NOINLINE H3Index _h3Rotate60cw | ( | H3Index | h | ) |
Rotate an H3Index 60 degrees clockwise.
h | The H3Index. |
Definition at line 629 of file h3Index.hpp.
References _rotate60cw(), H3_GET_INDEX_DIGIT, H3_GET_RESOLUTION, H3_SET_INDEX_DIGIT, and run_benchmark_import::res.
Referenced by _faceIjkToH3(), _h3RotatePent60cw(), and _h3ToFaceIjk().
EXTENSION_NOINLINE H3Index _h3RotatePent60ccw | ( | H3Index | h | ) |
Rotate an H3Index 60 degrees counter-clockwise about a pentagonal center.
h | The H3Index. |
Definition at line 564 of file h3Index.hpp.
References _h3LeadingNonZeroDigit(), _h3Rotate60ccw(), _rotate60ccw(), H3_GET_INDEX_DIGIT, H3_GET_RESOLUTION, H3_SET_INDEX_DIGIT, K_AXES_DIGIT, and run_benchmark_import::res.
Referenced by _faceIjkToH3().
EXTENSION_NOINLINE H3Index _h3RotatePent60cw | ( | H3Index | h | ) |
Rotate an H3Index 60 degrees clockwise about a pentagonal center.
h | The H3Index. |
Definition at line 590 of file h3Index.hpp.
References _h3LeadingNonZeroDigit(), _h3Rotate60cw(), _rotate60cw(), H3_GET_INDEX_DIGIT, H3_GET_RESOLUTION, H3_SET_INDEX_DIGIT, K_AXES_DIGIT, and run_benchmark_import::res.
EXTENSION_NOINLINE bool _h3ToFaceIjk | ( | H3Index | h, |
FaceIJK(fijk) | |||
) |
Convert an H3Index to a FaceIJK address.
h | The H3Index. |
fijk | The corresponding FaceIJK address. |
Definition at line 783 of file h3Index.hpp.
References _adjustOverageClassII(), _downAp7r(), _h3LeadingNonZeroDigit(), _h3Rotate60cw(), _h3ToFaceIjkWithInitializedFijk(), _isBaseCellPentagon(), _upAp7r(), baseCellData, CoordIJK, CoordIJK_clone, CoordIJK_copy, FaceIJK_copy, H3_GET_BASE_CELL, H3_GET_RESOLUTION, isResClassIII(), NO_OVERAGE, and run_benchmark_import::res.
Referenced by _h3ToGeo().
EXTENSION_NOINLINE int _h3ToFaceIjkWithInitializedFijk | ( | H3Index | h, |
FaceIJK(fijk) | |||
) |
Convert an H3Index to the FaceIJK address on a specified icosahedral face.
h | The H3Index. |
fijk | The FaceIJK address, initialized with the desired face and normalized base cell coordinates. |
Definition at line 753 of file h3Index.hpp.
References _downAp7(), _downAp7r(), _isBaseCellPentagon(), _neighbor(), H3_GET_BASE_CELL, H3_GET_INDEX_DIGIT, H3_GET_RESOLUTION, I_INDEX, isResClassIII(), J_INDEX, K_INDEX, and run_benchmark_import::res.
Referenced by _h3ToFaceIjk().
EXTENSION_NOINLINE bool _h3ToGeo | ( | H3Index | h3, |
GeoCoord(g) | |||
) |
Determines the spherical coordinates of the center point of an H3 index.
h3 | The H3 index. |
g | The spherical coordinates of the H3 cell center. Note: spherical coordinates are in radians. |
Definition at line 834 of file h3Index.hpp.
References _faceIjkToGeo(), _h3ToFaceIjk(), FaceIJK, and H3_GET_RESOLUTION.
Referenced by h3ToGeoPacked(), h3ToLat(), and h3ToLon().