I was just taking a look at the osm slippy map tiling scheme and i observed that although at zoom level 1 the split along y (latitude) seems exactly half (-85 deg to 0 deg to 85 deg), at zoom level 2 the splitting is quite uneven (0 to 66 deg to 85 deg). As a result if i try to download a tile assuming even splitting there seems to be significant difference. Can you tell me why the split is such and is there any way it could be mapped to a perfectly splitting tiling scheme? asked 13 Oct '13, 15:32 raveesh |
This has to do with the projection being used. This is usually mercator, which doesn't use the same scale near the equator and near the poles. The tiles always split the previous zoom's image evenly, but that original image may be deformed in ways you didn't expect. However, it is possible to setup a slippymap with a different projection setting for mapnik. If you want all tiles from a given zoomlevel to span as many degrees latitude as longitude, try the equirectangular projection. However, remember that no projection is perfect, and you'll need to deal with deformations one way or another. One way to sidestep the deformation problem is to use a 3D renderer like marble, which takes the mercator-projected tiles from OSM and reprojects them on a globe. answered 14 Oct '13, 13:17 Vincent de P... ♦ |
The splitting is not uneven. The map goes from -85 to +85 latitude on all zoom levels, and from coordinate "0" to coordinate "2**z-1" on all zoom levels. answered 13 Oct '13, 17:13 Frederik Ramm ♦ I am sorry, i didnt get it. At zoom level 0 we have one tile covering the entire earth (-85 to +85 latitude and -180 to +180 longitude) . At zoom level 1 there are 4 tiles (-85 to 0 and 0 to 85 in latitude and -180 to 0 and 0 to 180 in longitude). But at zomm level 2 the split becomes uneven ( -85 to -66, -66 to 0, 0 to 66, 66 to 85 in latitude and -180 to -90, -90 to 0, 0 to 90, 90 to 180 in longitude). So in longitude it still remains perfectly half splitting but in latitude it doesnt. Am i wrong?
(13 Oct '13, 17:40)
raveesh
|
What is your actual problem? If you want to determine the name of the slippy map tile for a given latitude, longitude and zoom level then just read the slippy map tilenames wiki page.
Actually in my app, i have a map with perfectly splitting tiling scheme(latitude -> -90, -45, 0, 45, 90). I was trying to see if i could download and attach some osm images on top of these tiles for some particular country. But due to the difference the data is quite different from what i expect. Hence on Africa, i almost end up mapping Europe. My only question is why was it chosen to be uneven and how can i still make use of it in a perfecty even tiling scheme environment?
I don't know why it was chosen like this but the only solutions seems to be cutting and stitching. Use the formula to calculate which and how many OSM tiles are required in order to create a specific tile for your application. Then download them (without violating the tile usage policy) and generate your tile from it. Or just use a WMS server which does all the magic for you.