This answer is based on my reading of the route.c code over the last few weeks. It may be very wrong if I have misunderstood!
I assume you want to know about junctions in the route.c context - things may be different in other navit parts such as the GUI or when generating turn instructions.
As far as I have seen, there is no special handling for junctions. So determine if a point is a junction by counting the number of segments leading away from it (the list route_graph_point.start, if I remember correctly), but taking allowance of one-way and two-way streets. A point on a two-way street will not be a junction if exactly two segments start at it. A point on a one-way street will not be a junction if exactly one segment starts at it. It will be more complicated if there is a junction between a two-way street and several one-way streets.
As you mention waypoints, I guess you have a route calculated. In that case, the point will have a segment (route_graph_point.seg, if I remember correctly) which points to the next segment to get to the destination. I think you can tell if the point is a junction on your route by looking at the list of segments starting at that point, and ignoring the segments (a) to the destination, and (b) the segment used to reach the point. If there are segments remaining, it's a junction. I guess you may need to look at the underlying item id to determine if your route changes items, in which case there might be road marking to make an explicit junction (such as "Give Way" or "Stop") but you may also need to look at the item depth to work out who has priority, if that matters.
Hope that helps, and hope that it's correct!
|