samedi 28 février 2015

Web Mercator formulas spitting out blatantly incorrect values

I've been trying to convert some latitude and longitude coordinates to Web Mercator pixel form, and the formulas listed on wikipedia are spitting out blatantly incorrect values. Wikipedia says the world coordinates go from 0 to 256 on the X and Y axis when not scaled. The formulas listed on the wikipedia page easily spit out values a large amount above 256.


For example, a longitude of 87.7494 radians, when plugged into the formula for the X-axis, produces 3703.23219542. This value is way above 256.


Try it yourself: (128 / pi) * (2 ^ 0) * (87.7494 + pi)





Aucun commentaire:

Enregistrer un commentaire