I would like to be able to map geographic points from WGS84, I believe, formatted for ms sql server, to the set of cells it would touch if the same coordinate pair were to be tessallated into an sql server spatial index with 4 hiearchical grids of 256 cells each.
The sql server 2008 spatial index does not ideally suit our needs because it doesn't support the use of both geographic and non-geographic data within the same index.
If we knew how to perform the translation ourselves it would seem like that would allow us to bypass the above limitation.
this page shows visually how a geography point can be mapped to planar cells which can be individually encoded as a sequence of from 1 and up to 4 positive integers. For an example of numbered cells please refer to the section "Deepest-Cell Rule" within the linked page.
I'm basically looking for pseduo-code on how to do just that.
Any help will be appreciated and if you know the algorithmic details that would be very much appreciated.
Thank you in advance.