I am working on a geospacial service and using Hilbert Curves to convert latitude and longitude to a Quadtree Key.
For example, At level 30:
45.5337699,-122.6988316 converts to 2/221022201033023103222221213221
(Nob Hill)
This can then be converted to an S2 Cell ID of
6094788552675374000
When comparing to a nearby location of:
45.5308839,-122.6815796 >> 2/221022201033330012321301320023
(Pearl District)
S2 ID: 6094788657473797000
It's easy to see that I can do a scan on the HB Quatree Key on prefix 2/221022201033
and get both the Nob Hill and Pearl District returned and any other points that fall within that prefix.
What I don't understand is why taking a further step of converting the HB Quadtree Key to an S2Cell ID (which seems to be how many are people are implementing this geo-location technique) is necessary. It too can be scanned. In this case on the prefix 6094788
. Does anyone know why this extra step is being taken and if it is necessary from an accuracy standpoint?