[OSM-dev] Sphere / Web-Mercator

Dane Springmeyer blake at hailmail.net
Thu Oct 9 17:00:09 BST 2008


Hi Dominic,

If you are into reading, here's some code that nicely commented:

http://trac.osgeo.org/gdal/browser/sandbox/klokan/globalmaptiles.py

Cheers,

Dane


On Oct 9, 2008, at 8:38 AM, Dominik Spies wrote:

> Hi,
>
> I'm trying to implement some projection-code for a project of mine..
> But I have some trouble with the Mercator projection.
>
> I understood that the projection we use in the slippy map is called
> Sphere / Web-Mercator, or EPSG:900913 or EPSG:3785 and is also used by
> Google, MS, Yahoo and so on..
>
> So there is some description on MSDN
> (http://msdn.microsoft.com/en-us/library/bb259689.aspx) which says:
>
> y = 0.5 – log((1 + sin(Latitude)) / (1 – sin(Latitude))) / (4 * pi)
>
> on some other pages and wikipedia I found that one:
>
> y = 0.5 * ln( (1 + sin(Latitude)) / (1 – sin(Latitude)) )
>
> where this is called the projection for GoogleMaps.
>
>
> So - this is not the same. I understand that the first one is somehow
> clipped to Lat +-85.05... and then scaled to 0 to 1.
>
> Huh, the second one. what scale is this? I can't figure out how to  
> use it..
>
> Can someone point me into the right direction? Something to read?
>
> Regards,
>
> Dominik
>
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/dev





More information about the dev mailing list