Fix routability now that we don't chop off a step

This commit is contained in:
Lauren Budorick 2016-03-31 13:21:14 -07:00 committed by Patrick Niklaus
parent 825a422721
commit c06f2a50f1
2 changed files with 2 additions and 2 deletions

View File

@ -72,7 +72,7 @@ module.exports = function () {
if (r.status) { if (r.status) {
r.route = this.wayList(r.json.routes[0]); r.route = this.wayList(r.json.routes[0]);
if (r.route === util.format('w%d', i)) { if (r.route.split(',')[0] === util.format('w%d', i)) {
r.time = r.json.routes[0].duration; r.time = r.json.routes[0].duration;
r.distance = r.json.routes[0].distance; r.distance = r.json.routes[0].distance;
r.speed = r.time > 0 ? parseInt(3.6 * r.distance / r.time) : null; r.speed = r.time > 0 ? parseInt(3.6 * r.distance / r.time) : null;

View File

@ -4,7 +4,7 @@ Feature: Avoid weird loops caused by rounding errors
Background: Background:
Given the profile "testbot" Given the profile "testbot"
Scenario: Weired sidestreet loops Scenario: Weird sidestreet loops
Given the node map Given the node map
| a | 1 | b | 2 | c | 3 | d | | a | 1 | b | 2 | c | 3 | d |
| | | | | | | | | | | | | | | |