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)

Issue Links

relates to

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

- Daily journey time
- Time moving
- Time stationary
- Avg Speed
- Modal Speed
- Distance travelled (Might be a bit processor intensive though)
- Number of journeys recorded

Part way through implementation, but current implementation is likely to fail if journeys falling within a day are processed in seperate stats runs - something that's more likely with the monthly stats. Will need to rework the selection mechanism to ensure that the full day/month gets reworked.

An 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)

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.

As a temporary workaround, the aggregate modal should be used when generating charts/stats. As it's a temporary workaround we'll just not store that data in the stats table until a proper fix is created for VEH-33.

## 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:36Ben Tasker Permalink2019-09-09 16:22:07Realistically, this project's not going to see any further development (other than possibly some bug fixes for anything new that's found).

Closing any outstanding issues as Won't Fix

Unassigned Permalink2019-09-09 16:22:07Unassigned Permalink2019-09-09 16:22:07