olp-cpp-sdk
1.22.0
|
A helper structure for basic operations on 64-bit Morton quadkeys. More...
#include <TileKey.h>
Public Member Functions | |
constexpr | QuadKey64Helper (std::uint64_t key) |
The default constructor. | |
constexpr QuadKey64Helper | Parent () const |
Gets the quadkey of the parent. More... | |
constexpr QuadKey64Helper | Child () const |
Gets the quadkey representing the first child of this quad. More... | |
QuadKey64Helper | GetSubkey (int delta) const |
Gets a subquadkey that is a relative of its parent. More... | |
QuadKey64Helper | AddedSubkey (QuadKey64Helper sub_key) const |
Gets the absolute quadkey that is constructed from its subquadkey. More... | |
Static Public Member Functions | |
static constexpr std::uint32_t | RowsAtLevel (std::uint32_t level) |
Gets the number of rows at a given level. More... | |
static constexpr std::uint32_t | ChildrenAtLevel (std::uint32_t level) |
Gets the number of children at a level. More... | |
Public Attributes | |
std::uint64_t | key {0} |
The representation of this quadkey. | |
A helper structure for basic operations on 64-bit Morton quadkeys.
This class can be used to prevent conversions between tile keys and quadkeys for basic operations.
QuadKey64Helper olp::geo::QuadKey64Helper::AddedSubkey | ( | QuadKey64Helper | sub_key | ) | const |
Gets the absolute quadkey that is constructed from its subquadkey.
It is the reverse function of GetSubkey()
. It returns the absolute quad key in the tree based on a subquadkey.
sub_key | The subquadkey generated with ToSubQuadKey() . |
|
inlineconstexpr |
Gets the quadkey representing the first child of this quad.
|
inlinestaticconstexpr |
Gets the number of children at a level.
It is 4 to the power of the level.
level | The requested level. |
QuadKey64Helper olp::geo::QuadKey64Helper::GetSubkey | ( | int | delta | ) | const |
Gets a subquadkey that is a relative of its parent.
Use this function to generate subkeys that are relatives of a parent that is delta levels up in the subtree.
You can also use this function to create shortened keys for quads on lower levels if the parent is known.
delta | The number of levels that are relatives of the parent quadkey. Must be greater or equal to 0 and smaller than 32. |
|
inlineconstexpr |
Gets the quadkey of the parent.
|
inlinestaticconstexpr |
Gets the number of rows at a given level.
It is 2 to the power of the level.
level | The requested level. |