Geohash decoding
Decoding reverses the geohash encoding: it takes a base-32 string and recovers the rectangle of latitude and longitude it represents. This is useful when you have stored geohashes in a database and need to map them back to coordinates, or when debugging a spatial index.
How it works
Each character is converted to its 5 bit value in the geohash alphabet. The bits are read most significant first and alternate between refining longitude (first) and latitude. Every 1 bit narrows the range to its upper half and every 0 bit to its lower half, starting from -180 to 180 for longitude and -90 to 90 for latitude.
gbsuv7ztq -> center near 50.998, -1.499 (with a small bounding box)
After all bits are consumed, the surviving range is the cell, and its midpoint is the reported center.
Example and tips
A short geohash like gcp covers a wide region, so its bounding box is large; a
long one like gcpvj0duq localises to a few metres. When comparing two
geohashes, a shared prefix means the cells overlap or nest, which is the property
that makes geohashes efficient for proximity search. Use the bounding box to
gauge how much rounding the original coordinate underwent.