From e9c2e4cf73cafbc90e22bc1a938c537307442619 Mon Sep 17 00:00:00 2001 From: jandegr Date: Fri, 2 Oct 2015 19:31:00 +0200 Subject: Update navigation.c --- navit/navigation.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'navit/navigation.c') diff --git a/navit/navigation.c b/navit/navigation.c index 888a64d09..6f889373a 100644 --- a/navit/navigation.c +++ b/navit/navigation.c @@ -1623,7 +1623,7 @@ navigation_itm_new(struct navigation *this_, struct item *routeitem) ret->way.item=*streetitem; item_hash_insert(this_->hash, streetitem, ret); - mr=map_rect_new(streetitem->map, NULL); + mr=map_rect_new(streetitem->map, NULL); struct map *tmap = streetitem->map; @@ -1679,7 +1679,7 @@ navigation_itm_new(struct navigation *this_, struct item *routeitem) } } } - + navigation_itm_update(ret, routeitem); @@ -1704,6 +1704,13 @@ navigation_itm_new(struct navigation *this_, struct item *routeitem) ret->start=c[0]; ret->end=c[i]; + if(item_attr_get(routeitem, attr_route, &route_attr)) + graph_map = route_get_graph_map(route_attr.u.route); + if (graph_map ) + { + navigation_itm_ways_update(ret,graph_map); + } + /* If we have a ramp, check the map for higway_exit info, * but only on the first node of the ramp. * We are doing the same for motorway-like roads because some @@ -1714,10 +1721,11 @@ navigation_itm_new(struct navigation *this_, struct item *routeitem) * If present, obtain exit_ref, exit_label and exit_to * from the map. */ - if ( (streetitem->type == type_ramp) - || (streetitem->type == type_highway_land) - || (streetitem->type == type_highway_city) - || (streetitem->type == type_street_n_lanes)) { + if ((streetitem->type == type_ramp) || ( + ret->way.next && ret->way.next->next && + ((streetitem->type == type_highway_land) + || (streetitem->type == type_highway_city) || (streetitem->type == type_street_n_lanes)))) + { struct map_selection mselexit; struct item *rampitem; dbg(lvl_debug,"test ramp\n"); @@ -1725,7 +1733,7 @@ navigation_itm_new(struct navigation *this_, struct item *routeitem) mselexit.u.c_rect.lu = c[0] ; mselexit.u.c_rect.rl = c[0] ; mselexit.range = item_range_all; - mselexit.order = 18; + mselexit.order =18; map_rect_destroy(mr); mr = map_rect_new(tmap, &mselexit); @@ -1740,12 +1748,12 @@ navigation_itm_new(struct navigation *this_, struct item *routeitem) if (attr.type && attr.type == attr_label) { dbg(lvl_debug,"exit_label=%s\n",attr.u.str); - ret->way.exit_label= map_convert_string(streetitem->map,attr.u.str); + ret->way.exit_label= map_convert_string(tmap,attr.u.str); } if (attr.type == attr_ref) { dbg(lvl_debug,"exit_ref=%s\n",attr.u.str); - ret->way.exit_ref= map_convert_string(streetitem->map,attr.u.str); + ret->way.exit_ref= map_convert_string(tmap,attr.u.str); } if (attr.type == attr_exit_to) { @@ -1759,7 +1767,7 @@ navigation_itm_new(struct navigation *this_, struct item *routeitem) && (this_->last) && (!(this_->last->way.item.type == type_ramp))) { char *destination_raw; - destination_raw=map_convert_string(streetitem->map,attr.u.str); + destination_raw=map_convert_string(tmap,attr.u.str); dbg(lvl_debug,"destination_raw from exit_to =%s\n",destination_raw); if ((split_string_to_list(&(ret->way),destination_raw, ';')) < 2) /* @@ -1776,10 +1784,6 @@ navigation_itm_new(struct navigation *this_, struct item *routeitem) } } } - - if(item_attr_get(routeitem, attr_route, &route_attr)) - graph_map = route_get_graph_map(route_attr.u.route); - dbg(lvl_debug,"i=%d start %d end %d '%s' \n", i, ret->way.angle2, ret->angle_end, ret->way.name_systematic); map_rect_destroy(mr); } else { @@ -1791,9 +1795,6 @@ navigation_itm_new(struct navigation *this_, struct item *routeitem) if (this_->last) { this_->last->next=ret; ret->prev=this_->last; - if (graph_map) { - navigation_itm_ways_update(ret,graph_map); - } } dbg(lvl_debug,"ret=%p\n", ret); this_->last=ret; -- cgit v1.2.1