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

Function split

src/Functions/GeoHash.cpp:134–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132}
133
134inline std::tuple<Encoded, Encoded> split(const Encoded & combined, uint8_t precision)
135{
136 Encoded lat;
137 Encoded lon;
138 lat.fill(0);
139 lon.fill(0);
140
141 size_t i = 0;
142 for (; i < precision * BITS_PER_SYMBOL - 1; i += 2)
143 {
144 // longitude is even bits
145 lon[i / 2] = combined[i];
146 lat[i / 2] = combined[i + 1];
147 }
148 // precision is even, read the last bit as lat.
149 if (precision & 0x1)
150 {
151 lon[i / 2] = combined[precision * BITS_PER_SYMBOL - 1];
152 }
153
154 return std::tie(lon, lat);
155}
156
157inline void base32Encode(const Encoded & binary, uint8_t precision, char * out)
158{

Callers 15

obfuscateQuery.cppFile · 0.70
executeTypeMethod · 0.70
executeTypeMethod · 0.70
geohashDecodeFunction · 0.70
writeStartElementMethod · 0.50
declareNamespacesMethod · 0.50
processNameMethod · 0.50
insertMethod · 0.50
splitMethod · 0.50

Calls 1

fillMethod · 0.45

Tested by 2

getSSEAndSignedHeadersFunction · 0.40
TESTFunction · 0.40