views:

108

answers:

1

http://wiki.openstreetmap.org/wiki/Mercator

With the C# example in the above link, I am able to project lat/lon to x/y co-ordinates. However, I'm having problem with scaling. I wonder how much length (in miles?) each pixel have after projection. I would like to scale the map before rendering as 500 pixels per mile or something like that.

Guys, really nobody to answer this? It's been quite long without answer.

A: 

The pixels will not be the same length, it depends on which area of the globe you are projecting. The mercator preserves angles, not lengths.

http://en.wikipedia.org/wiki/Mercator_projection

Look at the map - the areas around the poles are scaled up compared to the equator. Depending on what you want to do, you'd be better of using a standarized projection, like UTM. You should check which projection is used in the part of the world where your maps are from.

Another way would be to apply the inverse projection to two of your pixels to get the geographic coordinates and measure the great circle distance between them. Wikipedia has more info on that, but there is usually a bit of math involved.

TheFogger
Transverse Mercator inherits the same properties of Mercator. But if you stick to a small area (at 500 pixels per mile you probably are!), and use the appropriate UTM zone, the scale will be near-enough constant over your whole map.
MarkJ