GPXIN-11: Stationary time calculations may be inaccurate



Issue Information

Issue Type: Improvement
 
Priority: Major
Status: Closed

Reported By:
Ben Tasker
Assigned To:
Ben Tasker
Project: PHP GPXIngest (GPXIN)
Resolution: Fixed (2017-07-04 12:54:43)
Affects Version: 1.02,
Target version: 1.03,

Created: 2013-11-18 07:56:00
Time Spent Working


Description
The calculation of time stationary may be inaccurate;

|time|speed|
|10|20|
|20|20|
|30|0|
|40|0|
|50|5|

If the chart above was used, GPXIngest would calculate a stationary time of 20 seconds ((30 - 20) + (40-30)) .

However, during (at least some of) the 10 seconds between 20 & 30, the vehicle would have been decelerating.

Really what needs to happen, is we need to look at whether the last speed was 0, and consider the block moving time if not. So the car in the chart above would have been stationary for around 10 seconds, and moving for 30

Obviously we might actually have been stationary for slightly longer, but there's no way to know how far into the interval we either stopped or started moving, so it seems better to lock it to the interval's beginning so that the maths at least follows more easily in your head.


Toggle State Changes

Activity


btasker added '1.02' to Version

Repo: PHP-GPX-Ingest
Commit: 1b03decc32844a58858952df6bdba64dd8177bfd
Author: B Tasker <github@<Domain Hidden>>

Date: Tue Jul 04 12:51:32 2017 +0100
Commit Message: GPXIN-11 Fix stationary time calculations.

There was a minor issue with the way stationary time was calculated, meaning it'd actually be calculated higher than was true.

See http://projects.bentasker.co.uk/jira_projects/browse/GPXIN-11.html for an explanation of the issue



Modified (-)(+)
-------
src/GPXIngest/GPXIngest.php




Webhook User-Agent

GitHub-Hookshot/18889e1


View Commit

btasker changed status from 'Open' to 'Resolved'
btasker added 'Fixed' to resolution
btasker changed status from 'Resolved' to 'Closed'