Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2016-06-28 16:45:36 +0300
committerVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2016-07-23 10:25:10 +0300
commit504eca3c8df132eb2a6cc3d1736ae44762cdbc3a (patch)
treea77ec0b9d4c4d429045f631b84f38f52b29d90db /routing
parent06a48f68e87d06147d726827d131af4bd19bd62c (diff)
Using altitude for bicycle and pedestrian routing.
Diffstat (limited to 'routing')
-rw-r--r--routing/routing_algorithm.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/routing/routing_algorithm.cpp b/routing/routing_algorithm.cpp
index a4d0e85c0a..6f2fb26410 100644
--- a/routing/routing_algorithm.cpp
+++ b/routing/routing_algorithm.cpp
@@ -19,7 +19,9 @@ double constexpr KMPH2MPS = 1000.0 / (60 * 60);
inline double TimeBetweenSec(Junction const & j1, Junction const & j2, double speedMPS)
{
ASSERT(speedMPS > 0.0, ());
- return MercatorBounds::DistanceOnEarth(j1.GetPoint(), j2.GetPoint()) / speedMPS;
+ double const distanceM = MercatorBounds::DistanceOnEarth(j1.GetPoint(), j2.GetPoint());
+ double const altidudeDiffM = j2.GetAltitude() - j1.GetAltitude();
+ return sqrt(distanceM * distanceM + altidudeDiffM * altidudeDiffM) / speedMPS;
}
/// A class which represents an weighted edge used by RoadGraph.