MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / longLatFromMember

Function longLatFromMember

src/geo.cpp:114–120  ·  view source on GitHub ↗

Input Argument Helper */ Decode lat/long from a zset member's score. * Returns C_OK on successful decoding, otherwise C_ERR is returned. */

Source from the content-addressed store, hash-verified

112/* Decode lat/long from a zset member's score.
113 * Returns C_OK on successful decoding, otherwise C_ERR is returned. */
114int longLatFromMember(robj_roptr zobj, robj *member, double *xy) {
115 double score = 0;
116
117 if (zsetScore(zobj, szFromObj(member), &score) == C_ERR) return C_ERR;
118 if (!decodeGeohash(score, xy)) return C_ERR;
119 return C_OK;
120}
121
122/* Check that the unit argument matches one of the known units, and returns
123 * the conversion factor to meters (you need to divide meters by the conversion

Callers 1

georadiusGenericFunction · 0.85

Calls 3

zsetScoreFunction · 0.85
szFromObjFunction · 0.85
decodeGeohashFunction · 0.85

Tested by

no test coverage detected