springmeyer / arc.js

great circle routes in javascript
http://springmeyer.github.io/arc.js/
BSD 2-Clause "Simplified" License
369 stars 69 forks source link

Arcs go way beyond the map #33

Closed marksurnin closed 2 years ago

marksurnin commented 7 years ago

While developing something that looks like an airline routes map with Leaflet.Arc plugin (that wraps arc.js), I noticed that certain arcs (e.g. Seattle - Abu Dhabi) seriously overflow the edges of the map. This makes perfect sense in a 3D Context where that line would go near the North Pole and would be geometrically correct. However, in a 2D context, I'd imagine it would make sense for arcs to stay within latitude bounds. Is that something worth considering?

screen shot 2016-12-03 at 2 47 56 pm
SirenHound commented 7 years ago

I don't see what the problem here is, surely this library is to calculate the shortest distance on the Great Circles in a 3D context, the 2D context is depends only on your projection and would produce a longer line along the earths surface in situations like this. It doesn't really go beyond the "edges of the map" except that the line takes it outside the maximum latitude of this projection, rather that the points near the edge are close together, and if you had a projection that went all the way to 90, and a line that went exactly through the pole, they would represent the same point.

jgravois commented 2 years ago

lines overflowing the boundaries of the mercator projection is definitely something that is 'as designed'.

i'll close this one out, but i'm happy to keep discussing if anyone has further questions.