Meaning of heading parameter for via routing

Say we have four points A,B,C,D with four headings: 90,180,270,0. Currently this is interpreted as:

  • start at A in direction 90 (East)
  • arrive at B in direction 180 (South)
  • arrive at C in direction 270 (West)
  • arrive at D in direction 0 (North)

It is not interpreted as (as I would have assumed):

  • start at A in direction 90 (East)
  • start at B in direction 180 (South)
  • start at C in direction 270 (West)
  • arrive at D in direction 0 (North)

Is this intended? And is it the desired behavior (for people maybe using this, @devemux, @boldtrn?

If we set pass_through=true it does not make a difference (as long as heading enforcement worked).

The heading in 1st point is more important for navigation purposes to start driving in a specific direction.

For the rest points according to documentation:

“It is important to note that if you force the heading at via or end points the outgoing heading needs to be specified. I.e. if you want to force “coming from south” to a destination you need to specify the resulting “heading towards north” instead, which is 0.”

So far I only use the first heading parameter. I wasn’t aware that the behavior of the heading parameter changes for subsequent points. It somehow makes sense, because for the last point we can only change the direction of the arrival.

In general I am not so sure about how useful heading is for other points than the first one. I think for the other points I would be more interested in either pass_through or curbside?

Hm with the same logic it also makes sense to use the heading as start direction for all points (except the last) because for the first point we can only change the starting direction. And since heading is mostly interesting for the start point it makes a lot more sense to me this way :slight_smile: Ok but good to know that you are mostly using heading for the start location. Honestly, I think the only reason the heading at via points is interpreted as it is is because it was (slightly) easier to implement (but not really because all that needs to be changed is the iteration order in one loop) :slight_smile:

Documentation (written & linked above) states that the behavior of heading parameter is the same (outgoing heading) for all points?

I think we can imagine the heading as a little arrow attached to a (via) point. Specifying something like heading=90 means that this arrow points to the right (East). And the direction of this arrow is the travel direction at this via point. But what the docs say nothing about is whether this affects the route arriving at the via point or the route starting at the via point. For the first and last points there is no difference because there is either only a route starting there or only a route arriving there. But for via points the heading only affects one of the routes and currently it affects the arrival direction at the via point but not (and I think this is not intuitive at all) the start direction at the via point (for the next leg). Unless of course pass_through=true in which case the start direction of the next leg is chosen to be the arrival direction of the previous leg.

1 Like

Or in other words: Currently we cannot use heading to specify the start direction at a via point (as we can do for the first point), but we can only specify the arrival direction at via points.

Powered by Discourse