GEOHASH returns the Geohash strings (see https://en.wikipedia.org/wiki/Geohash) of the given members. If any members were not found, they will not be present in the returned map. Cost is O(1) / 1 RCU for each member. Works similar to https://redis.io/commands/geohash
(key string, members ...string)
| 126 | // |
| 127 | // Works similar to https://redis.io/commands/geohash |
| 128 | func (c Client) GEOHASH(key string, members ...string) (geohashes map[string]string, err error) { |
| 129 | geohashes = make(map[string]string) |
| 130 | locations, err := c.GEOPOS(key, members...) |
| 131 | |
| 132 | for _, member := range members { |
| 133 | if location, found := locations[member]; found { |
| 134 | geohashes[member] = location.Geohash() |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | return |
| 139 | } |
| 140 | |
| 141 | // GEOPOS returns the stored locations for each of the given members, as a map of member to location. |
| 142 | // If a member cannot be found, it will not be present in the returned map. |