Add:Core:Option to get matched direction from map matching
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 1 Feb 2012 13:13:56 +0000 (13:13 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 1 Feb 2012 13:13:56 +0000 (13:13 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4919 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/attr_def.h
navit/navit/track.c

index 7e7704b..9eaf019 100644 (file)
@@ -375,6 +375,7 @@ ATTR(position_hdop)
 ATTR(position_radius)
 ATTR(position_longitude)
 ATTR(position_latitude)
+ATTR(position_direction_matched)
 ATTR2(0x0005ffff,type_double_end)
 ATTR2(0x00060000,type_coord_geo_begin)
 ATTR(position_coord_geo)
index f2df828..bfe3a8e 100644 (file)
@@ -95,7 +95,7 @@ struct tracking {
        struct attr *attr;
        int valid;
        int time;
-       double direction;
+       double direction, direction_matched;
        double speed;
        int coord_geo_valid;
        struct coord_geo coord_geo;
@@ -345,6 +345,9 @@ tracking_get_attr(struct tracking *_this, enum attr_type type, struct attr *attr
        case attr_position_direction:
                attr->u.numd=&_this->direction;
                return 1;
+       case attr_position_direction_matched:
+               attr->u.numd=&_this->direction_matched;
+               return 1;
        case attr_position_speed:
                attr->u.numd=&_this->speed;
                return 1;
@@ -751,6 +754,7 @@ tracking_update(struct tracking *tr, struct vehicle *v, struct vehicleprofile *v
                                tr->pos=i;
                                tr->curr[0]=sd->c[i];
                                tr->curr[1]=sd->c[i+1];
+                               tr->direction_matched=t->angle[i];
                                dbg(1,"lpnt.x=0x%x,lpnt.y=0x%x pos=%d %d+%d+%d+%d=%d\n", lpnt.x, lpnt.y, i, 
                                        transform_distance_line_sq(&sd->c[i], &sd->c[i+1], &cin, &lpnt_tmp),
                                        tracking_angle_delta(tr, tr->curr_angle, t->angle[i], 0)*tr->angle_pref,