forum for navit navigation tool
It is currently 27 Sep 2022, 13:50
View unanswered posts | View active topics

All times are UTC

Forum rules

Feel free to ask anything here related to the development process - coding, creating new features, fixing bugs and custom changes of Navit.

Note: For reporting bugs, use the bug tracker.

Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Route path - which node is a junctions
PostPosted: 26 Jun 2013, 08:25 

Joined: 14 Jun 2013, 12:09
Posts: 10
based on the topic "route path coordinates" i want to find out, which waypoint coordinate refers to a junction.

it would be perfect, if it would be possible to get the information that this node is a junction, even if i don't have to make a turn at this node.

another extra special would be, if i could get some additional information about the junction. e.g. the traffic rules at this junction or how many roads cross this junction.

but first of all i need to know, wheter a node is a junction or not.

thank you very much for your help, so far...

 Post subject: Re: Route path - which node is a junctions
PostPosted: 13 Aug 2013, 10:42 

Joined: 07 Jul 2013, 10:08
Posts: 8
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!

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Silver Orange 2.0.6 for IPB Designed by Skins and Hosting
Converted for phpBB3, based on Royal Blue template by BigB © 2007 2008 AEON KINGS