Map Control: Zoom Levels -> Resolution

A common question we get is, "What is the resolution or scale at a particular zoom level in Virtual Earth or Windows Live Local?"  Well, that is actually a little more complex of answer than you might expect.  We use Mercator projection across the maps in the Virtual Earth Map Control so they can be be cut up into image tiles for quick delivery to clients and reliable stitching back together of the images.  But, because it is a cylindrical projection, the map gets distorted as you approach the poles--just look at Antarctica to see the effect.  So, we measure the effective resolution at the equator where there is the least distortion.  

The resolution at the equator for each zoom level (see this earlier post to find your current zoom level in Windows Live Local):

Meters/Pixel Zoom Level
78271.52 1
39135.76 2
19567.88 3
9783.94 4
4891.97 5
2445.98 6
1222.99 7
611.50 8
305.75 9
152.87 10
76.44 11
38.22 12
19.11 13
9.55 14
4.78 15
2.39 16
1.19 17
0.60 18
0.30 19

How did we arrive at these seemingly convoluted numbers? Well, honestly, we picked a view that we thought looked good at one of the closest zoom levels bottom and then just did some math to generate the rest--hence the kind of wacky numbers at higher zoom levels.

But, remember I said it was complicated? Well to get the resolution where you are looking on the map, you actually have to do some quick math as it varies by latitude. To get the resolution where you are:

Map resolution = 156543.04 meters/pixel * cos(latitude) / (2 ^ zoomlevel)

But, what about Scale--this is just resolution?

For you cartographers or junior explorers out there, who think not in resolution but in map scale ratios, you can do a little more math to convery it correctly.  To convert the map resolution into scale, you need to know (or assume) the screen resolution.  Then the formula becomes:

Map scale = 1 : (ScreenRes pixels/inch * 39.37 inches/meter * 156543.04 meters/pixel * cos(latitude * pi/180) / (2 ^ zoomlevel))

For example, assuming a ScreenRes of 100 pixels/inch, the map scale at level 10 and latitude 40 degrees is:

Map scale = 1 : (100 pixels/inch * 39.37 inches/meter * 156543.04 meters/pixel * cos(40 * pi/180) / (2 ^ 10))
Map scale = 1 : (100 * 39.37 * 156543.04 * 0.766 / 1024)
Map scale = 1 : 461028.73

You can thank Joe, a Tech Lead on Virtual Earth, for the excellent explanation.