Geo coordinates, 2 points routes and mercator projection

Recently I was solving simple graphical task: draw routes between airports on the 2d map. All the airport coordinates were known, so my task was just place this airports points in the right place on map and draw a routes between them. I've used a . The next step took me about 4 hours away to find simple equation to map [ lat, lon ] coordinates to [ x, y ]. And finally I got it: Good, we have an instrument to draw points on 2d mercator projection. Next big question is what is the shortest line between 2 points on sphere? Which coordinate could be variable, and which is dependent? The answer is: longitude is variable and latitude is dependent. Explanation of this decision is very simple: projection lines curvature. If we change latitude only with invariant longitude line projection we draw is approximately straight. But with variable longitude and invariant latitude line projection looks like part of ellipse. And the last serious question here is when should we draw routes via Pacific ocean and how our approximation equation will be modified? It's evident that if physical distance between points over Pacific ocean lower than over Atlantic, we should draw split route. So, here is our conditional statement: This value could be saved as additional boolean flag on route object initialization. And modified latitude calculation look: Source.


Яндекс.Метрика Рейтинг@Mail.ru Free Web Counter
page counter
Last Modified: August 30, 2014 @ 12:00 am