Closed TRomijn closed 6 years ago
I think the problem lies in the use of our namedtuple Point
and the fact we are using the 0
index to get the longitude and the 1
index to get latitude on the given coordinates.
See below :
In [41]: coord = (13.3888, 52.517033) # (longitude, latitude)
In [42]: coord[0] # longitude
Out[42]: 13.3888
In [43]: coord_Point1 = Point(13.3888, 52.517033)
In [44]: coord_Point1[0] # longitude
Out[44]: 13.3888
In [45]: coord_Point2 = Point(longitude=13.3888, latitude=52.517033)
In [46]: coord_Point2[0] # Not the longitude!
Out[46]: 52.517033
I will submit a PR to fix it.
In version 0.11.1 I think there is a mistake in the way the routes for the routing table are calculated.
Either the Point object or the osrm.table function swaps the latitudes and longitudes. The workaround to get good results now is to create Point objects with swapped latitudes and longitudes.
You can test it with: