Computes a 64 bit value that corresponds to the hilbert space filling curve
| 60 | |
| 61 | // Computes a 64 bit value that corresponds to the hilbert space filling curve |
| 62 | inline std::uint64_t GetHilbertCode(const Coordinate &coordinate) |
| 63 | { |
| 64 | const std::uint32_t x = static_cast<std::int32_t>(coordinate.lon) + |
| 65 | static_cast<std::int32_t>(180 * COORDINATE_PRECISION); |
| 66 | const std::uint32_t y = static_cast<std::int32_t>(coordinate.lat) + |
| 67 | static_cast<std::int32_t>(90 * COORDINATE_PRECISION); |
| 68 | return HilbertToLinear(x, y); |
| 69 | } |
| 70 | } // namespace osrm::util |
| 71 | |
| 72 | #endif /* HILBERT_VALUE_HPP */ |
no test coverage detected