I'm working on automating various analyses of movement and activities based on various sizable (50K→500K) sets of datetime/latitude/longitude data.
I'd like to determine "Average Moving Speed".
- Parts of the recordset will have little or no movement
- Other parts will have movement of varying speeds (ie., walking or driving), and,
- A few records will (frustratingly) contain what I assume are GPS errors: Sudden "hops" to an unrealistic distance, returning to the previous location in the following record.
Is there a standard method of determining Average Moving Speed?
Perhaps a minimum distance that is considered "actual movement" as opposed to GPS resolution or reporting issues, or
Maybe there is a standard formula or algorithm that I haven't found yet.
I'm comfortable with coding and I've brainstormed and experimented with a few methods but each seems to have it's own issues.
Skipping every n records (Surely the worst option.)
Skipping records between "whole minutes" or "whole 3 minutes" etc (Some legitimate movement would be missed.)
An interpretation of Rolling Average.
I figure that once I can extrapolate Average Moving Speed, I will be able to deduce Activity Type -- ie., whether the movement was most likely walking, driving, flying, idle, etc... but I'd be interested to hear thoughts about that as well.
From what I understand Rolling Average would be, instead of looking at the current record, take an average of n records before and n records after the current record.
If that's the case, there could still be various interpretations:
Take separate averages of the
n + n + 1Lon's & Lat's and use those numbers to calculate movement
Averages of each
n + n + 1records elapsed time, divided by Averages of each
n + n + 1records' distance traveled
I will try out any ideas you may have and report my findings back here.
An example of the data (with distance [meters] and time [seconds] added, at individual-record level): (and this link to a downloadable 200-record CSV sample)
Some places I've looked for insight (without success, unless I missed something):