OmniSciDB
a5dc49c757
|
Header file for CoordIJK functions including conversion from lat/lon. More...
#include "QueryEngine/ExtensionFunctions/h3lib/include/h3api.h"
#include "QueryEngine/ExtensionFunctions/h3lib/include/vec2d.h"
#include "QueryEngine/ExtensionFunctions/h3lib/lib/coordijk.hpp"
Go to the source code of this file.
Macros | |
#define | I_INDEX 0 |
#define | J_INDEX 1 |
#define | K_INDEX 2 |
#define | CoordIJK(variable_name) int variable_name[3] |
#define | CoordIJK_ptr(variable_name) int* variable_name |
#define | CoordIJK_clone(ijk) { ijk[I_INDEX], ijk[J_INDEX], ijk[K_INDEX] } |
#define | CoordIJK_copy(dest_ijk, src_ijk) |
#define | CoordIJKArray(variable_name, size) int variable_name[size][3] |
Enumerations | |
enum | Direction { CENTER_DIGIT = 0, K_AXES_DIGIT = 1, J_AXES_DIGIT = 2, JK_AXES_DIGIT = J_AXES_DIGIT | K_AXES_DIGIT, I_AXES_DIGIT = 4, IK_AXES_DIGIT = I_AXES_DIGIT | K_AXES_DIGIT, IJ_AXES_DIGIT = I_AXES_DIGIT | J_AXES_DIGIT, INVALID_DIGIT = 7, NUM_DIGITS = INVALID_DIGIT } |
H3 digit representing ijk+ axes direction. Values will be within the lowest 3 bits of an integer. More... | |
Header file for CoordIJK functions including conversion from lat/lon.
References two Vec2d cartesian coordinate systems:
Definition in file coordijk.h.
#define CoordIJK | ( | variable_name | ) | int variable_name[3] |
Definition at line 45 of file coordijk.h.
Referenced by _adjustOverageClassII(), _downAp7(), _downAp7r(), _faceIjkToH3(), _h3ToFaceIjk(), _ijkRotate60ccw(), _ijkRotate60cw(), and _unitIjkToDigit().
Definition at line 47 of file coordijk.h.
Referenced by _adjustOverageClassII(), _faceIjkToH3(), _h3ToFaceIjk(), and _unitIjkToDigit().
#define CoordIJK_copy | ( | dest_ijk, | |
src_ijk | |||
) |
#define CoordIJK_ptr | ( | variable_name | ) | int* variable_name |
Definition at line 46 of file coordijk.h.
Referenced by _adjustOverageClassII(), and _faceIjkToH3().
#define CoordIJKArray | ( | variable_name, | |
size | |||
) | int variable_name[size][3] |
Definition at line 53 of file coordijk.h.
#define I_INDEX 0 |
Definition at line 42 of file coordijk.h.
Referenced by _adjustOverageClassII(), _downAp7(), _downAp7r(), _faceIjkToBaseCell(), _faceIjkToBaseCellCCWrot60(), _faceIjkToH3(), _h3ToFaceIjkWithInitializedFijk(), _hex2dToCoordIJK(), _ijkAdd(), _ijkMatches(), _ijkNormalize(), _ijkRotate60ccw(), _ijkRotate60cw(), _ijkScale(), _ijkSub(), _ijkToHex2d(), _setIJK(), _upAp7(), and _upAp7r().
#define J_INDEX 1 |
Definition at line 43 of file coordijk.h.
Referenced by _adjustOverageClassII(), _downAp7(), _downAp7r(), _faceIjkToBaseCell(), _faceIjkToBaseCellCCWrot60(), _faceIjkToH3(), _h3ToFaceIjkWithInitializedFijk(), _hex2dToCoordIJK(), _ijkAdd(), _ijkMatches(), _ijkNormalize(), _ijkRotate60ccw(), _ijkRotate60cw(), _ijkScale(), _ijkSub(), _ijkToHex2d(), _setIJK(), _upAp7(), and _upAp7r().
#define K_INDEX 2 |
Definition at line 44 of file coordijk.h.
Referenced by _adjustOverageClassII(), _downAp7(), _downAp7r(), _faceIjkToBaseCell(), _faceIjkToBaseCellCCWrot60(), _faceIjkToH3(), _h3ToFaceIjkWithInitializedFijk(), _hex2dToCoordIJK(), _ijkAdd(), _ijkMatches(), _ijkNormalize(), _ijkRotate60ccw(), _ijkRotate60cw(), _ijkScale(), _ijkSub(), _ijkToHex2d(), _setIJK(), _upAp7(), and _upAp7r().
enum Direction |
H3 digit representing ijk+ axes direction. Values will be within the lowest 3 bits of an integer.
Definition at line 75 of file coordijk.h.
EXTENSION_NOINLINE bool _downAp7 | ( | CoordIJK(ijk) | ) |
Find the normalized ijk coordinates of the hex centered on the indicated hex at the next finer aperture 7 counter-clockwise resolution. Works in place.
ijk | The ijk coordinates. |
Definition at line 325 of file coordijk.hpp.
References _ijkAdd(), _ijkNormalize(), _ijkScale(), CoordIJK, I_INDEX, J_INDEX, and K_INDEX.
Referenced by _faceIjkToH3(), and _h3ToFaceIjkWithInitializedFijk().
EXTENSION_NOINLINE bool _downAp7r | ( | CoordIJK(ijk) | ) |
Find the normalized ijk coordinates of the hex centered on the indicated hex at the next finer aperture 7 clockwise resolution. Works in place.
ijk | The ijk coordinates. |
Definition at line 348 of file coordijk.hpp.
References _ijkAdd(), _ijkNormalize(), _ijkScale(), CoordIJK, I_INDEX, J_INDEX, and K_INDEX.
Referenced by _faceIjkToH3(), _h3ToFaceIjk(), and _h3ToFaceIjkWithInitializedFijk().
EXTENSION_NOINLINE bool _hex2dToCoordIJK | ( | const | Vec2dv, |
CoordIJK(h) | |||
) |
Determine the containing hex in ijk+ coordinates for a 2D cartesian coordinate vector (from DGGRID).
v | The 2D cartesian coordinate vector. |
h | The ijk+ coordinates of the containing hex. |
Definition at line 54 of file coordijk.hpp.
References _ijkNormalize(), I_INDEX, J_INDEX, K_INDEX, M_SIN60, X_INDEX, and Y_INDEX.
Referenced by _geoToFaceIjk().
EXTENSION_INLINE bool _ijkAdd | ( | const | CoordIJKh1, |
const | CoordIJKh2, | ||
CoordIJK(sum) | |||
) |
Add two ijk coordinates.
h1 | The first set of ijk coordinates. |
h2 | The second set of ijk coordinates. |
sum | The sum of the two sets of ijk coordinates. |
Definition at line 184 of file coordijk.hpp.
References I_INDEX, J_INDEX, and K_INDEX.
Referenced by _adjustOverageClassII(), _downAp7(), _downAp7r(), _ijkRotate60ccw(), _ijkRotate60cw(), and _neighbor().
EXTENSION_INLINE int _ijkMatches | ( | const | CoordIJKc1, |
const | CoordIJKc2 | ||
) |
Returns whether or not two ijk coordinates contain exactly the same component values.
c1 | The first set of ijk coordinates. |
c2 | The second set of ijk coordinates. |
Definition at line 172 of file coordijk.hpp.
References I_INDEX, J_INDEX, and K_INDEX.
Referenced by _unitIjkToDigit().
EXTENSION_NOINLINE bool _ijkNormalize | ( | CoordIJK(c) | ) |
Normalizes ijk coordinates by setting the components to the smallest possible values. Works in place.
c | The ijk coordinates to normalize. |
Definition at line 224 of file coordijk.hpp.
References I_INDEX, J_INDEX, and K_INDEX.
Referenced by _adjustOverageClassII(), _downAp7(), _downAp7r(), _faceIjkToH3(), _hex2dToCoordIJK(), _ijkRotate60ccw(), _ijkRotate60cw(), _neighbor(), _unitIjkToDigit(), _upAp7(), and _upAp7r().
EXTENSION_NOINLINE bool _ijkRotate60ccw | ( | CoordIJK(ijk) | ) |
Rotates ijk coordinates 60 degrees counter-clockwise. Works in place.
ijk | The ijk coordinates. |
Definition at line 385 of file coordijk.hpp.
References _ijkAdd(), _ijkNormalize(), _ijkScale(), CoordIJK, I_INDEX, J_INDEX, and K_INDEX.
Referenced by _adjustOverageClassII().
EXTENSION_NOINLINE bool _ijkRotate60cw | ( | CoordIJK(ijk) | ) |
Rotates ijk coordinates 60 degrees clockwise. Works in place.
ijk | The ijk coordinates. |
Definition at line 407 of file coordijk.hpp.
References _ijkAdd(), _ijkNormalize(), _ijkScale(), CoordIJK, I_INDEX, J_INDEX, and K_INDEX.
Referenced by _adjustOverageClassII().
EXTENSION_INLINE bool _ijkScale | ( | CoordIJK(c) | , |
int | factor | ||
) |
Uniformly scale ijk coordinates by a scalar. Works in place.
c | The ijk coordinates to scale. |
factor | The scaling factor. |
Definition at line 211 of file coordijk.hpp.
References I_INDEX, J_INDEX, and K_INDEX.
Referenced by _adjustOverageClassII(), _downAp7(), _downAp7r(), _ijkRotate60ccw(), and _ijkRotate60cw().
EXTENSION_INLINE bool _ijkSub | ( | const | CoordIJKh1, |
const | CoordIJKh2, | ||
CoordIJK(diff) | |||
) |
Subtract two ijk coordinates.
h1 | The first set of ijk coordinates. |
h2 | The second set of ijk coordinates. |
diff | The difference of the two sets of ijk coordinates (h1 - h2). |
Definition at line 198 of file coordijk.hpp.
References I_INDEX, J_INDEX, and K_INDEX.
Referenced by _adjustOverageClassII(), and _faceIjkToH3().
EXTENSION_INLINE bool _ijkToHex2d | ( | const | CoordIJKh, |
Vec2d(v) | |||
) |
Find the center point in 2D cartesian coordinates of a hex.
h | The ijk coordinates of the hex. |
v | The 2D cartesian coordinates of the hex center point. |
Definition at line 155 of file coordijk.hpp.
References I_INDEX, J_INDEX, K_INDEX, M_SQRT3_2, X_INDEX, and Y_INDEX.
Referenced by _faceIjkToGeo().
EXTENSION_NOINLINE bool _neighbor | ( | CoordIJK(ijk) | , |
int | digit | ||
) |
Find the normalized ijk coordinates of the hex in the specified digit direction from the specified ijk coordinates. Works in place.
ijk | The ijk coordinates. |
digit | The digit direction from the original ijk coordinates. |
Definition at line 372 of file coordijk.hpp.
References _ijkAdd(), _ijkNormalize(), CENTER_DIGIT, and NUM_DIGITS.
Referenced by _h3ToFaceIjkWithInitializedFijk().
EXTENSION_NOINLINE int _rotate60ccw | ( | int | digit | ) |
Rotates indexing digit 60 degrees counter-clockwise. Returns result.
digit | Indexing digit (between 1 and 6 inclusive) |
Definition at line 429 of file coordijk.hpp.
References I_AXES_DIGIT, IJ_AXES_DIGIT, IK_AXES_DIGIT, J_AXES_DIGIT, JK_AXES_DIGIT, and K_AXES_DIGIT.
Referenced by _h3Rotate60ccw(), and _h3RotatePent60ccw().
EXTENSION_NOINLINE int _rotate60cw | ( | int | digit | ) |
Rotates indexing digit 60 degrees clockwise. Returns result.
digit | Indexing digit (between 1 and 6 inclusive) |
Definition at line 453 of file coordijk.hpp.
References I_AXES_DIGIT, IJ_AXES_DIGIT, IK_AXES_DIGIT, J_AXES_DIGIT, JK_AXES_DIGIT, and K_AXES_DIGIT.
Referenced by _h3Rotate60cw(), and _h3RotatePent60cw().
EXTENSION_INLINE bool _setIJK | ( | CoordIJK(ijk) | , |
int | i, | ||
int | j, | ||
int | k | ||
) |
Sets an IJK coordinate to the specified component values.
ijk | The IJK coordinate to set. |
i | The desired i component value. |
j | The desired j component value. |
k | The desired k component value. |
Definition at line 40 of file coordijk.hpp.
References I_INDEX, J_INDEX, and K_INDEX.
Referenced by _adjustOverageClassII().
EXTENSION_NOINLINE int _unitIjkToDigit | ( | const | CoordIJKijk | ) |
Determines the H3 digit corresponding to a unit vector in ijk coordinates.
ijk | The ijk coordinates; must be a unit vector. |
Definition at line 266 of file coordijk.hpp.
References _ijkMatches(), _ijkNormalize(), CENTER_DIGIT, CoordIJK, CoordIJK_clone, INVALID_DIGIT, and NUM_DIGITS.
Referenced by _faceIjkToH3().
EXTENSION_NOINLINE bool _upAp7 | ( | CoordIJK(ijk) | ) |
Find the normalized ijk coordinates of the indexing parent of a cell in a counter-clockwise aperture 7 grid. Works in place.
ijk | The ijk coordinates. |
Definition at line 287 of file coordijk.hpp.
References _ijkNormalize(), I_INDEX, J_INDEX, and K_INDEX.
Referenced by _faceIjkToH3().
EXTENSION_NOINLINE bool _upAp7r | ( | CoordIJK(ijk) | ) |
Find the normalized ijk coordinates of the indexing parent of a cell in a clockwise aperture 7 grid. Works in place.
ijk | The ijk coordinates. |
Definition at line 306 of file coordijk.hpp.
References _ijkNormalize(), I_INDEX, J_INDEX, and K_INDEX.
Referenced by _faceIjkToH3(), and _h3ToFaceIjk().