mapbox-directions-swift icon indicating copy to clipboard operation
mapbox-directions-swift copied to clipboard

Strange behaviour with "walking" profile

Open Juju31Fr opened this issue 4 years ago • 8 comments

Hello,

I noticed some critical differences with regard to the information provided when the profile "walking" is selected. Differences are:

  • intersections: when using "cycling" for instance, the first element of the array represents the intersections at the maneuver location, and you get all the roads crossing at that point. With walking, they are 2 only: the approach and outlet. The other roads crossing are no more indicated.
  • roundabout: with "walking", roundabouts are splited in a succession of turn steps, sometimes 3 or 4 over a distance of 20 meters ...

Is it some bugs, or wanted behavior ? I believe this could at least be an option added in RouteOptions and allowing the user to choose what is the expected behavior.

Regards,

Julien

Juju31Fr avatar May 17 '21 08:05 Juju31Fr

Both these behaviors would be dependent on the routing engine.

/cc @mapbox/navigation-api

1ec5 avatar May 18 '21 15:05 1ec5

@Juju31Fr could you post some complete examples of requests with the two behaviors?

purew avatar May 18 '21 15:05 purew

For the intersection topic.

For demonstration, I use these 2 coordinates: 1 - CLLocationCoordinate2D(latitude: 48.840761398698106, longitude: 2.2450660820018413) 2 - CLLocationCoordinate2D(latitude: 48.841065620500814, longitude: 2.2445880620556125) This a very simple route, with 1 intersection only. The request produces 3 RouteSteps: 1 depart, 1 turn, 1 arrive. Capture d’écran 2021-05-18 à 17 48 34

let waypoint1 = Waypoint(coordinate: CLLocationCoordinate2D(latitude: 48.840761398698106, longitude: 2.2450660820018413), coordinateAccuracy: 50, name: "") let waypoint2 = Waypoint(coordinate: CLLocationCoordinate2D(latitude: 48.841065620500814, longitude: 2.2445880620556125), coordinateAccuracy: 50, name: "") let routeOptions = RouteOptions(waypoints: [waypoint1, waypoint2], profileIdentifier: .cycling) Directions.shared.calculate(routeOptions)

The intersections array for the intermediate RouteStep is as follow using the "cycling" profile: Capture d’écran 2021-05-18 à 18 16 57 We can see the 3 "branches" of this intersection (75, 165, 345).

Now the same output using the "walking" profile: Capture d’écran 2021-05-18 à 18 15 18 The 165 degrees is no more there ...

Juju31Fr avatar May 18 '21 16:05 Juju31Fr

@Juju31Fr ~This is due to a difference in the underlying engine between the two profiles. The walking profile is the new version and we are working on migrating Cycling to use this same version. So in time this difference should go away as we finish our migration.~

EDIT: This actually seems like a bug. We've reported it internally.

purew avatar May 18 '21 16:05 purew

For the roundabout topic.

For demonstration, I use these 2 other coordinates: 1 - CLLocationCoordinate2D(latitude: 48.84381207205462, longitude: 2.17447780455754) 2 - CLLocationCoordinate2D(latitude: 48.84344198184451, longitude: 2.1749755688772154) This is a roundabout. Capture d’écran 2021-05-18 à 18 53 15

Using the "cycling" profile, I get 2 RouteSteps to describe the roundabout: 1 takeRoundabout, and 1 exitRoundabout (because I have requested it in the options): Capture d’écran 2021-05-18 à 19 12 54

With the "walking" profile, I get 3: 1 turn, 1 continue, 1 turn, each of them separated by few meters only. Capture d’écran 2021-05-18 à 19 12 37 It would be nice to get the possibility (with an option may be) to have the "cycling" behavior for the walking profile as well.

I take an example: if you want to route a mountain bike workout, you need to select "walking" to get the ability to go off-road on trails. But when you come back on road, it's better to go through a roundabout with one instruction only explaining that you have to use the 2nd or 3rd exit, instead of having few turn/continue instructions every 2 or 3 seconds ...

Juju31Fr avatar May 18 '21 17:05 Juju31Fr

Walking and cycling roundabout instructions are handled differently

dgearhart avatar May 18 '21 18:05 dgearhart

I understand that. But as an enhancement, would it be possible to let the developer/user select which behavior is the most suitable for the use case, through an option or a parameter ?

Juju31Fr avatar May 18 '21 19:05 Juju31Fr

This one should be fixed. Please check https://github.com/mapbox/mapbox-directions-swift/issues/563

stari4ek avatar Jan 26 '22 12:01 stari4ek