1 | *** ../../sdk/navit/navit/track.c 2011-01-15 15:27:29.912572374 +0100 |
---|
2 | --- track.c 2011-01-15 13:11:49.162572353 +0100 |
---|
3 | *************** |
---|
4 | *** 97,102 **** |
---|
5 | --- 97,103 ---- |
---|
6 | int time; |
---|
7 | double direction; |
---|
8 | double speed; |
---|
9 | + int maxspeed; |
---|
10 | int coord_geo_valid; |
---|
11 | struct coord_geo coord_geo; |
---|
12 | enum projection pro; |
---|
13 | *************** |
---|
14 | *** 360,365 **** |
---|
15 | --- 361,369 ---- |
---|
16 | return 0; |
---|
17 | attr->u.item=&_this->curr_line->street->item; |
---|
18 | return 1; |
---|
19 | + case attr_maxspeed: |
---|
20 | + attr->u.num = _this->maxspeed; |
---|
21 | + return 1; |
---|
22 | default: |
---|
23 | if (! _this->curr_line || ! _this->curr_line->street) |
---|
24 | return 0; |
---|
25 | *************** |
---|
26 | *** 708,713 **** |
---|
27 | --- 712,718 ---- |
---|
28 | min=INT_MAX/2; |
---|
29 | while (t) { |
---|
30 | struct street_data *sd=t->street; |
---|
31 | + // find the closest street to the current location |
---|
32 | for (i = 0; i < sd->count-1 ; i++) { |
---|
33 | value=tracking_value(tr,t,i,&lpnt,min,-1); |
---|
34 | if (value < min) { |
---|
35 | *************** |
---|
36 | *** 727,738 **** |
---|
37 | tr->curr_out.x=lpnt.x; |
---|
38 | tr->curr_out.y=lpnt.y; |
---|
39 | tr->coord_geo_valid=0; |
---|
40 | ! if (angle_delta < 70) |
---|
41 | ! tr->street_direction=1; |
---|
42 | ! else if (angle_delta > 110) |
---|
43 | ! tr->street_direction=-1; |
---|
44 | ! else |
---|
45 | tr->street_direction=0; |
---|
46 | min=value; |
---|
47 | } |
---|
48 | } |
---|
49 | --- 732,759 ---- |
---|
50 | tr->curr_out.x=lpnt.x; |
---|
51 | tr->curr_out.y=lpnt.y; |
---|
52 | tr->coord_geo_valid=0; |
---|
53 | ! |
---|
54 | ! // Direction of vehicle on street |
---|
55 | ! if (angle_delta < 70) { |
---|
56 | ! tr->street_direction=1; |
---|
57 | ! |
---|
58 | ! if (sd->maxspeed_forward > -1) |
---|
59 | ! tr->maxspeed=sd->maxspeed_forward; |
---|
60 | ! else |
---|
61 | ! tr->maxspeed=sd->maxspeed; |
---|
62 | ! } else if (angle_delta > 110) { |
---|
63 | ! tr->street_direction=-1;// backward |
---|
64 | ! |
---|
65 | ! if (sd->maxspeed_backward > -1) |
---|
66 | ! tr->maxspeed=sd->maxspeed_backward; |
---|
67 | ! else |
---|
68 | ! tr->maxspeed=sd->maxspeed; |
---|
69 | ! } else { |
---|
70 | tr->street_direction=0; |
---|
71 | + |
---|
72 | + tr->maxspeed=sd->maxspeed; |
---|
73 | + } |
---|
74 | + |
---|
75 | min=value; |
---|
76 | } |
---|
77 | } |
---|