# Converting miles above ground to zoom level?

I've got a spec that details what features are to appear on a map at certain number of miles above the earth. So for example "Render this point when closer than 400 miles above the earth".

How do I convert that to a scale? I'm using a standard zxy base map so I need to change the spec to "render this point when zoom level greater than 6"

Is there a standard calculation for this?

• Most mapping software uses scale, which is a rough approximation, due to pixel size in the physical monitor. Height above Earth is even more approximate, since it depend on distance form the monitor. Commented Jan 25, 2017 at 12:11
• You want to convert "miles above the earth" to something like "1:25,000 scale"? And what do you mean by "standard zoom level"? Commented Jan 25, 2017 at 12:33
• @Spacedman edited to try and make myself clearer. by standard zoom level I mean the 1-20 levels that google use. Commented Jan 25, 2017 at 15:43

I don't know if there is a standard formula for calculating zoom level based on altitude but you can do some trigonometric calculations.

I assume your field of view is nadir which means `FOV(angle) = 45 degrees`

Altitude in your case, `A = 400 miles = 643738 meters`

and now i will assume your map extent is `1000 x 1000 pixels` so number of pixels from the center of map, `n = 500 px`

If `R` is the resolution in `meter/pixel` then we have the following relation:

``````tan FOV = n x R/A
R = A/n x tan FOV
``````

With `FOV = 45`, `A = 643738` and `n = 500` we get `R = 1287.5 m/px`

In this case your approximate map scale is `1:4,000,000` and `zoom level = 7`

Depends on your map extent, you can cross check resolution value in the above table and get your approximate map scale and zoom_level.

Hope this will solve your problem.

• Thanks, it's a great answer, better than my question deserves. But I'm confused why the size of the map is important. If I were on google maps in earth mode then the image at zoom level X is what I would see in my eye if I was hovering at Y meters above the earth regardless of screen size. Commented Jan 26, 2017 at 10:17