I'm creating a web interface where users click on a map to denote a point of interest. My application then returns all items in a database that lie within a specified distance of that point. I'm only concerned with UK (I mention this in case there's a good approximation available) and primarily working with zoom=9.
AIUI, each tile covers a certain angle of latitude and longitude rather than distances over the ground. Thanks to the information in this wiki article, I can calculate the distance between the top-left corners of adjacent tiles (and hence derive the distance over the ground for any tile), but that seems rather messy.
asked 08 Oct '10, 14:12
If you are happy with an approximation then think about this:
Or very roughly: A zoom level 9 tile in the UK has 40x40km. (Double the width/height when you decrement the zoom level, halve the width/height when you increment.)
You can calculate it yourself, based on this wiki page:
The resolution means how many meters per pixel you get. If you want to know how many pixels per meter, just use the inverse. That is:
And if you want to calculate the scale (to write it on the map for printing it):
The scale means, how many cm in reality is 1 cm on the paper (or on the screen).
So if you have a screen with 96 dpi, you get that one pixel is 1.1943 meters. And you get a scale of 1 : 4 231 which means that 1 cm on your screen is 42.3 m in reality.
If you have a printer which prints 300 dpi … (now do the calculations yourself).
answered 14 Feb, 12:10