I am refactoring a simplified planetary engine, and I would like the partition system to be compatible with the one in Outerra, for a mutually beneficial result. I originally used lat/long with OSM bitmap tiles. But this time, I am using OSM vector data. The goal is to store one binary file every 4 levels in exact alignment with your cube partitioning.

I understand you are normalizing vector(u,v,+-k) on the 6 faces of a cube, with k=1+0.2071067812(1-u2)(1-v2).

I am having a hard time mapping vector data on the cube though. The way I see it, I have to transform lat/long data into x,y,z on the sphere, then apply a Newton solver to transform x,y,z back to uv, which invariably has a negative effect on my mood ;-)

Would you do it that way, and if so, would you consider sharing the algo you use to reverse x,y,z back to u,v? In another thread, you are suggesting a look into a javascript file called cubeface.js but the link is broken.

Thanks in advance.