Hello,

I think that I found a bug in track statistics code.

Steps to reproduce the problem in viking built from freshly downloaded code:

1. open a gpx file with a single track that has some valid trackpoints; 
a TRW layer is created.
2. in the same layer draw a route.
3. in layers panel, mark the track as invisible, keep the route visible.
4. right-click the top layer, from menu select "Statistics".
5. toggle "Include Invisible Items" checkbox at the bottom of the dialog 
window.
6. observe values in "Average length" and "Max speed" category - when 
the checkbox is cleared, the two values are the same, with the same unit.

I think that the problem can be traced to this piece of code in 
src/viktrwlayer_analisis.c, starting in line 314:

default:
        //VIK_UNITS_SPEED_KILOMETRES_PER_HOUR:
        if ( ts.max_speed > 0 )
                g_snprintf ( tmp_buf, sizeof(tmp_buf), _("%.2f km/h"), 
(double)VIK_MPS_TO_KPH(ts.max_speed) );
        gtk_label_set_text ( GTK_LABEL(content[cnt++]), tmp_buf );

When only visible items are included in statistics (i.e. only the route, 
but not the  track), ts.max_speed is zero and tmp_buf is not updated 
properly, it still contains contents that has been set few lines earlier.

Best regards,
Kamil

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. http://sdm.link/zohodev2dev
_______________________________________________
Viking-devel mailing list
Viking-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viking-devel
Viking home page: http://viking.sf.net/

Reply via email to