Calculate tile from latitude and longitude
I'm trying to determine how the "TILE" field in the current_nodes table is calculated based off of the latitude and longitude.
I've seen the [slippy map tile names][1] and understand the concept of xtile vs. ytile. But I am failing to see the correlation between xtile, ytile, and the TILE value as seen in the current_nodes table. I've seen a write up on Bing about how [Bing makes the conversion][2], and it seems similar, but not exact to what OSM is doing. Any ideas?
As an example, using the following latitude and longitude, you should get the following:<br>
Lat: 52.5164839<br>
Lng: 13.3817427<br>
Tile: 3502687520
[1]: http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames
[2]: http://msdn.microsoft.com/en-us/library/bb259689.aspx