You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As an enhancement, the following patch uses the geopy library Vincenty (aliased as geopy.distance.distance) to calculate the geodesic distance between two points. The patch does introduce a dependency on the geopy library, but when tested I found it reduced the number files needed for caching and the time to run by 20-30%. (YMMV.)
@@ -28,6 +28,8 @@
import sys
import math
from loadOsm import LoadOsm
+from geopy import Point
+import geopy.distance
As an enhancement, the following patch uses the geopy library Vincenty (aliased as geopy.distance.distance) to calculate the geodesic distance between two points. The patch does introduce a dependency on the geopy library, but when tested I found it reduced the number files needed for caching and the time to run by 20-30%. (YMMV.)
@@ -28,6 +28,8 @@
import sys
import math
from loadOsm import LoadOsm
+from geopy import Point
+import geopy.distance
class Router(object):
def init(self, data):
@@ -39,10 +41,9 @@ class Router(object):
lat2 = self.data.rnodes[n2][0]
lon2 = self.data.rnodes[n2][1]
# TODO: projection issues
return(dist)
def doRoute(self,start,end):
The text was updated successfully, but these errors were encountered: