Given a list of coordinates, I need to create a line shapefile joining each of the point with a Python GDAL/OGR script. The procedure described here Convert XY points to a line? works fine in almost all cases, except when the points are crossing the date change meridian. When this happens, the line connects the two points by crossing the entire world, which is a obvious mistake.
How can I force the script to connect the 2 points through the shortest distance?
Here are some coordinate examples:
lon, lat 172.5, 50.0 175.0, 43.4 -175.0, 35.0 -173.1, 31 -172.1, 28.0 -171.3, 26.5 -173.9, 21.8