MCPcopy Create free account
hub / github.com/Project-OSRM/osrm-backend / GetHilbertCode

Function GetHilbertCode

include/util/hilbert_value.hpp:62–69  ·  view source on GitHub ↗

Computes a 64 bit value that corresponds to the hilbert space filling curve

Source from the content-addressed store, hash-verified

60
61// Computes a 64 bit value that corresponds to the hilbert space filling curve
62inline 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 */

Callers 1

StaticRTreeMethod · 0.85

Calls 1

HilbertToLinearFunction · 0.85

Tested by

no test coverage detected