I have an image and detect two points in the image. I want to calculate the distance between these two points. I'm using Google map and Bing map.
I have
- x,y pixel values for both two points
- zoom level 19, or something else
What I need is the pixels per meter ratio.
Best Answer
I have written this on Android and it works. Google map tiles are 256 device independent pixels. So this first line calculates a tile size in device dependent pixels. The second calculates the number of tiles at a given zoom level. The third calculates the size of a tile in meters at a given latitude for spherical projection. Then the final line will give you pixels per meter. This could be optimized a bit, but it should make sense.