Fix routability now that we don't chop off a step
This commit is contained in:
		
							parent
							
								
									b3aca211d6
								
							
						
					
					
						commit
						335be174d2
					
				@ -72,7 +72,7 @@ module.exports = function () {
 | 
			
		||||
                if (r.status) {
 | 
			
		||||
                    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.distance = r.json.routes[0].distance;
 | 
			
		||||
                        r.speed = r.time > 0 ? parseInt(3.6 * r.distance / r.time) : null;
 | 
			
		||||
 | 
			
		||||
@ -4,7 +4,7 @@ Feature: Avoid weird loops caused by rounding errors
 | 
			
		||||
    Background:
 | 
			
		||||
        Given the profile "testbot"
 | 
			
		||||
 | 
			
		||||
    Scenario: Weired sidestreet loops
 | 
			
		||||
    Scenario: Weird sidestreet loops
 | 
			
		||||
        Given the node map
 | 
			
		||||
            | a | 1 | b | 2 | c | 3 | d |
 | 
			
		||||
            |   |   |   |   |   |   |   |
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user