[OSM-dev] Proposal: Database accelerator and dirty tile marker based on simple algorithm.

Nick Hill nick at nickhill.co.uk
Mon Sep 18 14:50:29 BST 2006



Nigel Magnay wrote:
> The disadvantage is though that you have a bit of work to do in areas 
> which overlap (the +/-180 line), which you wouldn't have if the grid fit 
> the globe exactly - this is going to be a bit of a pain for things like 
> coastlines.

This is a good point, we would need to use a specific wrap algorithm, 
where the platform based binary calculation may provide a suitable wrap 
function. However, the borders would be at the pacific date line, mostly 
down the pacific ocean, and at the poles.


> 
>   The only thing that I think is bothering me is the "then interleave" 
> step. To perform this function don't you need to recurse around the 1E7 
> lon and lat figures shifting bits off, and isn't that exactly the same 
> as my inner loop ? And if that's the case, the fact that it's a 1E7 
> multiplication a bit unimportant, because that's not the "hard bit"? Or 
> is there some fancier way of interleaving bits I haven't thought of?
> 
No recursion is necessary. Only bit-shifting is necessary for the 
conversion. There are potentially single math operations to perform the 
function, although any function I can currently think of needs a CPU 
cycle per bit. But then again, I can think of a function which wold 
convert your recursive division tiles using the 11930464.711111111 
coefficient then bit-shifting.





More information about the dev mailing list