MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / decodeCoordinate

Function decodeCoordinate

src/Functions/GeoHash.cpp:91–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91inline Float64 decodeCoordinate(const Encoded & coord, Float64 min, Float64 max, uint8_t bits)
92{
93 Float64 mid = (max + min) / 2;
94 for (size_t i = 0; i < bits; ++i)
95 {
96 const auto c = coord[i];
97 if (c == 1)
98 {
99 min = mid;
100 }
101 else
102 {
103 max = mid;
104 }
105
106 mid = (max + min) / 2;
107 }
108
109 return mid;
110}
111
112inline Encoded merge(const Encoded & encodedLon, const Encoded & encodedLat, uint8_t precision)
113{

Callers 1

geohashDecodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected