flopp / py-staticmaps

A python module to create static map images with markers, geodesic lines, etc.
MIT License
128 stars 17 forks source link

Line arc extreme on long distances #21

Open ghost opened 2 years ago

ghost commented 2 years ago

Greetings. I would like to address an issue that is problematic to me using the library.

I create a journey that is from eastern Europe to the western USA.

The line, post-Mercator projection is so high that it covers Greenland.

Is there any way to adjust the height of the arc or is it only ever relative to the curvature of the earth between the distance of the to/from coordinates?

flopp commented 2 years ago

The line drawn between two points is the shortest surface path between those points and thus is a segment of a "great circle" (see https://en.wikipedia.org/wiki/Great_circle). Due to the mercator projection, these direct paths end up as curves.

Here's an example for the direct path between Kiev and San Francisco (you can switch between a 3D globe view and the mercator projection using the top right icons):

https://www.greatcirclemap.com/globe?routes=KBP-SFO

The direct path indeed goes across greenland, so the "extreme arc" drawn by py-staticmaps is correct.

3d-globe mercator

flopp commented 2 years ago

BTW, sorry for my late reply...

ghost commented 2 years ago

Thanks for the reply. I was just trying to make it more aesthetically pleasing.