I am new to ElasticSearch and I want to understand the difference between using geohashes and quadtree. In the reference it is written:
- GeohashPrefixTree - Uses geohashes for grid squares. Geohashes are base32 encoded strings of the bits of the latitude and longitude interleaved. So the longer the hash, the more precise it is. Each character added to the geohash represents another tree level and adds 5 bits of precision to the geohash. A geohash represents a rectangular area and has 32 sub rectangles. The maximum amount of levels in Elasticsearch is 24.
- QuadPrefixTree - Uses a quadtree for grid squares. Similar to geohash, quad trees interleave the bits of the latitude and longitude the resulting hash is a bit set. A tree level in a quad tree represents 2 bits in this bit set, one for each coordinate. The maximum amount of levels for the quad trees in Elasticsearch is 50.
I don't get the difference, for example if I take the point: Latitude / Longitude = 42.9123456, 21.799986 the geohash is srxs05fq8. Can anyone explain how can I calculate the quadtree representation?
Moreover, when is it better to prefer one over the other?