Need to create a module similar to that in VEH-19 to generate statistics based on JourneyTracks (chosen as adding a stat indicator to the trackpoints table would massively increase the table size due to the number of records)

relates to | VEH-33: Monthly/Daily Modal speeds may not be accurate |

## Activity

Unassigned Permalink2013-11-02 18:51:19Ben Tasker Permalink2013-11-09 04:13:47- Daily journey time

- Time moving

- Time stationary

- Avg Speed

- Modal Speed

- Distance travelled (Might be a bit processor intensive though)

- Number of journeys recorded

Ben Tasker Permalink2013-11-09 05:39:34An alternative would be to create a couple of stats points so that average speeds could be worked out incrementally. So as well as the stats above, we'd have the following stored in the stats table (though not necessarily user visible)

- Total speed (a sum of all trackpoints)

- Trackpoint count

Wouldn't help with modal speed though, the only way to (accurately) recalculate that would be to run back over all the trackpoints (which for an entire month might be an incredibly expensive operation)

Ben Tasker Permalink2013-11-09 06:00:37|Day|Speeds|Modal|

|1|65 65 65 65 65 65 70 70|65|

|2|65 70 70 70|70|

|3|65 65 65 65 70 70 70 70 70|70|

There are 10x70, 11x65 in that table. If we use the calculated modals we get a modal speed of 70, wherehas if we combine the number we (correctly) get 65.

One option might be to defer generation of monthly stats until the end of the month, and then re-run the month if a new journey trackpoint is added. Would need to get the scheduler up and running first though.

In the meantime, it probably makes sense to just not store the modal speed for the month (as hitting this issue for days is less likely) and where needed to aggregate the daily. Will raise a seperate bug for the fix.

Unassigned Permalink2013-11-09 06:10:07Ben Tasker Permalink2013-11-10 01:17:54Ben Tasker Permalink2013-11-10 01:19:24Unassigned Permalink2013-11-10 01:19:36Unassigned Permalink2013-11-10 01:19:36