1

I need a function to convert from tile pixels (x, y) from the Web Mercator projection (aka EPSG::3857 or SRID 900913), to longitude and latitude.

I'd like the function to be written in pseudo-code or a language like C. I'm writing a C++ program.

I apologize if this is a duplicate question but I'm having trouble finding the algorithm.

I have found an algorithm that converts longitude and latitude to tile pixels. But I'm not confident that I can rewrite it to do the opposite.

2

you can find a lot of formulas with nice explanation in this wonderful page:

http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/

They are in python but code is quite simple. Have fun!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.