146 if (parentRes > childRes) {
148 }
else if (parentRes == childRes) {
150 }
else if (parentRes < 0 || parentRes >
MAX_H3_RES) {
154 for (
int i = parentRes + 1; i <= childRes; i++) {
567 int foundFirstNonZeroDigit = 0;
576 foundFirstNonZeroDigit = 1;
593 int foundFirstNonZeroDigit = 0;
602 foundFirstNonZeroDigit = 1;
670 for (
int r = res - 1; r >= 0; r--) {
686 _ijkSub(lastIJK, lastCenter, diff);
719 for (
int i = 0; i < numRots; i++)
722 for (
int i = 0; i < numRots; i++) {
736 if (!std::isfinite(lat) || !std::isfinite(lon)) {
758 int possibleOverage = 1;
763 for (
int r = 1; r <=
res; r++) {
775 return possibleOverage;
862 int64_t decimal_lon =
864 int64_t decimal_lat =
866 return (decimal_lon & 0xFFFFFFFF) | ((decimal_lat & 0XFFFFFFFF) << 32);
#define H3_SET_INDEX_DIGIT(h3, res, digit)
EXTENSION_NOINLINE bool _h3ToGeo(H3Index h3, GeoCoord(g))
EXTENSION_INLINE int _h3LeadingNonZeroDigit(H3Index h)
EXTENSION_NOINLINE int _h3ToFaceIjkWithInitializedFijk(H3Index h, FaceIJK(fijk))
#define GeoCoord(variable_name)
EXTENSION_NOINLINE H3Index _h3RotatePent60cw(H3Index h)
EXTENSION_NOINLINE int _unitIjkToDigit(const CoordIJK(ijk))
EXTENSION_INLINE int isResClassIII(int res)
EXTENSION_NOINLINE double H3_EXPORT() h3ToLat(H3Index h3)
#define EXTENSION_NOINLINE
#define FaceIJK(variable_name)
EXTENSION_INLINE bool _ijkSub(const CoordIJK(h1), const CoordIJK(h2), CoordIJK(diff))
EXTENSION_NOINLINE bool _neighbor(CoordIJK(ijk), int digit)
EXTENSION_NOINLINE double H3_EXPORT() h3ToLon(H3Index h3)
EXTENSION_NOINLINE H3Index H3_EXPORT() geoToH3(const double lon, const double lat, int res)
find the H3 index of the resolution res cell containing the lat/lng
EXTENSION_INLINE double H3_EXPORT() radsToDegs(double radians)
converts radians to degrees
#define H3_SET_RESOLUTION(h3, res)
EXTENSION_NOINLINE bool _downAp7r(CoordIJK(ijk))
#define H3_SET_BASE_CELL(h3, bc)
EXTENSION_NOINLINE H3Index _faceIjkToH3(const FaceIJK(fijk), int res)
#define H3Index
the H3Index fits within a 64-bit unsigned integer
EXTENSION_NOINLINE H3Index H3_EXPORT() h3ToParent(H3Index h, int parentRes)
returns the parent (or grandparent, etc) hexagon of the given hexagon
EXTENSION_NOINLINE int64_t H3_EXPORT() h3ToGeoPacked(H3Index h3)
find the lat/lon center point g of the cell h3
EXTENSION_NOINLINE int _rotate60ccw(int digit)
DEVICE const BaseCellData baseCellData[NUM_BASE_CELLS]
Resolution 0 base cell data table.
#define H3_GET_BASE_CELL(h3)
#define CoordIJK_clone(ijk)
#define FaceIJK_copy(dest_ijk, src_ijk)
EXTENSION_NOINLINE H3Index _h3RotatePent60ccw(H3Index h)
#define CoordIJK_ptr(variable_name)
EXTENSION_NOINLINE bool _h3ToFaceIjk(H3Index h, FaceIJK(fijk))
Direction
H3 digit representing ijk+ axes direction. Values will be within the lowest 3 bits of an integer...
EXTENSION_INLINE int _isBaseCellPentagon(int baseCell)
Return whether or not the indicated base cell is a pentagon.
EXTENSION_NOINLINE int _rotate60cw(int digit)
Base cell related lookup tables and access functions.
#define CoordIJK(variable_name)
#define CoordIJK_copy(dest_ijk, src_ijk)
EXTENSION_INLINE bool _baseCellIsCwOffset(int baseCell, int testFace)
Find the FaceIJK given a base cell.
EXTENSION_INLINE int _faceIjkToBaseCellCCWrot60(const FaceIJK(h))
Find base cell given FaceIJK.
#define H3_GET_INDEX_DIGIT(h3, res)
EXTENSION_NOINLINE bool _faceIjkToGeo(const FaceIJK(h), int res, GeoCoord(g))
EXTENSION_NOINLINE bool _downAp7(CoordIJK(ijk))
#define FaceIJK_clone(fijk)
EXTENSION_NOINLINE bool _upAp7(CoordIJK(ijk))
EXTENSION_INLINE double H3_EXPORT() degsToRads(double degrees)
converts degrees to radians
EXTENSION_NOINLINE bool _upAp7r(CoordIJK(ijk))
EXTENSION_INLINE int _faceIjkToBaseCell(const FaceIJK(h))
Return whether the indicated base cell is a pentagon where all neighbors are oriented towards it...
#define H3_SET_MODE(h3, v)
EXTENSION_NOINLINE int _adjustOverageClassII(FaceIJK(fijk), int res, int pentLeading4, int substrate)
EXTENSION_NOINLINE bool _geoToFaceIjk(const GeoCoord(g), int res, FaceIJK(h))
EXTENSION_NOINLINE H3Index _h3Rotate60cw(H3Index h)
EXTENSION_NOINLINE bool _ijkNormalize(CoordIJK(c))
#define H3_GET_RESOLUTION(h3)
EXTENSION_NOINLINE H3Index _h3Rotate60ccw(H3Index h)