title: How to calculate the neighbouring grids on geohash. Algorithms required
body: <p>Hi I am working with a database with an implementation of geohash</p>
  
  <p><a href="https://i.stack.imgur.com/jpy6X.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jpy6X.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/JqeLr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JqeLr.png" alt="enter image description here"></a></p>
  
  <p>So as shown above, as the zoom level goes down (6 zoom levels), more of <code>abcd</code> gets inserted into each grid. I have represented them as a rigid grid; however, the central point is different for all the grids. So for example, distance from <code>a</code> to <code>b</code> will not be the same as distance from <code>a</code> to <code>c</code>.</p>
  
  <p>If it was a rigid grid, I can just get the closest four neighbouring grids; however, I cannot do that as the distances vary and the closest neighbours are not necessarily orthogonal. Only information that I have from the database is the centra point of each grid and the geohash key e.g. <code>aa</code>, <code>ab</code>, etc..</p>
  
  <p>How will I find girds that are just north, west, east and south of each grid for every zoom level? (have 6 zoom levels)</p>