diff options
Diffstat (limited to 'src/mongo/db/geo/hash.h')
-rw-r--r-- | src/mongo/db/geo/hash.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/db/geo/hash.h b/src/mongo/db/geo/hash.h index dbd357983e9..51d299b0248 100644 --- a/src/mongo/db/geo/hash.h +++ b/src/mongo/db/geo/hash.h @@ -128,6 +128,15 @@ namespace mongo { GeoHash parent(unsigned int level) const; GeoHash parent() const; + // Return the neighbors of closest vertex to this cell at the given level, + // by appending them to "output". Normally there are four neighbors, but + // the closest vertex may only have two or one neighbor if it is next to the + // boundary. + // + // Requires: level < this->_bits, so that we can determine which vertex is + // closest (in particular, level == kMaxBits is not allowed). + void appendVertexNeighbors(unsigned level, vector<GeoHash>* output) const; + private: // Create a hash from the provided string. Used by the std::string and char* cons. |