You are not logged in.

Announcement

*** NOTICE: forum.openstreetmap.org is being retired. Please request a category for your community in the new ones as soon as possible using this process, which will allow you to propose your community moderators.
Please create new topics on the new site at community.openstreetmap.org. We expect the migration of data will take a few weeks, you can follow its progress here.***

#1 2008-08-08 13:43:43

Barguast
Member
Registered: 2008-07-24
Posts: 4

Complex mathematical question... Help!

Okay... tongue

If I have a viewport of the Slippy map (Mercator projection) which is 'w' pixels wide, and 'h' pixels high, and we're at zoom-level 'Z', what is the range of x and y Mercator coordinates?

For example, if the viewport is 256 x 256 and we're at zoom level 0, then there should be a range of 360 x-coordinates (-180 to 180 degrees), and 360 y-coordinates (also -180 degrees).

I know, a bit of a strange question. Please reply if you have any questions (or answers for that matter!)

Offline

#2 2008-08-08 14:34:43

Barguast
Member
Registered: 2008-07-24
Posts: 4

Re: Complex mathematical question... Help!

Nevermind, I figured it out;

x-span = 360 * (width / (256 * (2 ^ zoom)))
y-span = 360 * (height / (256 * (2 ^ zoom)))

big_smile

Offline

Board footer

Powered by FluxBB