I don’t know much about PostGIS, but the principle should be the same.
In MongoDB, let’s discuss 2d index first. Chinese documents are all translated! http://docs.mongoing.com/manual-zh/core/geospatial-indexes.html
In MongoDB, 2d index can be used to index a point. We divide a square into 4 equal parts, numbered 00, 01, 10, 11, and then divide the small square containing the target point in the same way. After 32 times, we get a numbered sequence, which we can put together. Geohash has some good properties. For example, if the large square divided according to the above aspects contains a small square, the Geohash of the former is the prefix of the latter. Detailed information is available on Wikipedia.
For 2dsphere index, MongoDB uses S2 library to do Geohash, see slides on Google Doc.
Also, why do you want to know about Geohash? Is it necessary to understand what problems you encounter?
I don’t know much about PostGIS, but the principle should be the same.
In MongoDB, let’s discuss 2d index first. Chinese documents are all translated!
http://docs.mongoing.com/manual-zh/core/geospatial-indexes.html
In MongoDB, 2d index can be used to index a point. We divide a square into 4 equal parts, numbered 00, 01, 10, 11, and then divide the small square containing the target point in the same way. After 32 times, we get a numbered sequence, which we can put together. Geohash has some good properties. For example, if the large square divided according to the above aspects contains a small square, the Geohash of the former is the prefix of the latter. Detailed information is available on Wikipedia.
For 2dsphere index, MongoDB uses S2 library to do Geohash, see slides on Google Doc.
Also, why do you want to know about Geohash? Is it necessary to understand what problems you encounter?