Fix:Core:Count edges on roundabout nodes to avoid detecting false roundabouts
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 17 Dec 2008 18:13:01 +0000 (18:13 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 17 Dec 2008 18:13:01 +0000 (18:13 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@1825 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/route.c

index 0ba9fce..0a4f58a 100644 (file)
@@ -371,8 +371,9 @@ route_new(struct attr *parent, struct attr **attrs)
 static int
 route_check_roundabout(struct route_graph_segment *seg, int level, int direction, struct route_graph_segment *origin)
 {
-       struct route_graph_point_iterator it;
+       struct route_graph_point_iterator it,it2;
        struct route_graph_segment *cur;
+       int count=0;
 
        if (!level) {
                return 0;
@@ -393,7 +394,13 @@ route_check_roundabout(struct route_graph_segment *seg, int level, int direction
        } else {
                it = rp_iterator_new(seg->start);
        }
+       it2=it;
+       
+       while ((cur = rp_iterator_next(&it2)))
+               count++;
 
+       if (count > 3)
+               return 0;
        cur = rp_iterator_next(&it);
        while (cur) {
                if (cur == seg) {
@@ -1144,9 +1151,7 @@ route_path_add_item_from_graph(struct route_path *this, struct route_path *oldpa
        /* We check if the route graph segment is part of a roundabout here, because this
         * only matters for route graph segments which form parts of the route path */
        if (!(rgs->flags & AF_ROUNDABOUT)) { // We identified this roundabout earlier
-#if 0
                route_check_roundabout(rgs, 5, (dir < 1), NULL);
-#endif
        }
 
        segment->item=rgs->item;