I maintain a Python package (Pyvisgraph) that builds a visibility graph given set of simple obstacle polygons. I am using it to calculate shortest paths between two points on a map. The obstacles are world shorelines obtained from here.

My problem is that the map is a "regular" projection (I'm a novice at GIS), so there is no visibility across the "seams" of the map. As an example, if I calculate the shortest path from San Fransisco to Shanghai, the path would not cross the Pacific, but go the long way through the Indian Ocean and Atlantic. There is no visibility from the US west coast to East China, because that is where the map boundary is.

I read up on gnomonic projection, but seems that would only work for one hemisphere at a time.

I am thinking that with any projection you will still have this "seam" problem. Is there any technique or projection I can use that would solve my problem?

1 Answer 1


I'm afraid that no projection is able to handle Great Circles on the whole earth. You're trying to do Eucledian geometry on a sphere. I think your focus should be in implementing a way to work with spherical geometry and use the points' coordinates to draw the path on any projection as they do in these webpages:Great Circle Mapper or Javascript Great Circle.

The second one is in Javascript so hopefully you can have a look on how it works and translate it to Python.

Maybe the Haversine formula can help you too: Haversine or this in Python: great circle distance in python

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.