I searched through previous questions & didn't find an answer to this one. At first glance it might look like a straightforward math question & off-topic, but it is related to a fleet management system and has a definite GIS flavo(u)r, so I hope that I can get some advice here.
My GPS device will give me Lat/Long, timestamp and current speed. I can query once a second if I want, although that seems like overkill.
The point is that it only gives me current speed and I want average speed. From two consecutive readings I can compute the distance travelled and the time taken, so I know the average speed for that segment, but what if I want the average speed for one hour?
- do I just total the averages and average them?
- I am unsure whether to include readings of zero speed in the count of the number of measurements (which shows how bad my math is). What if I only take 2 readings per hour & both times the vehicle is tationary at traffic lights, but otherwise it moves rather quickly?
- I am not sure of what is a good sample frequency. I guess it might have to do with the anticipated average speed (e.g might differ between tracking combine harvesters & jet fighter planes)
- I am concerned that oversampling might reduce accuracy
Is there a 'standard' algorithm for this sort of thing?
[Update]
It might help if you can tell us what you want to use the average speed for. That will drive answers to "what do I do for zero speed events?" – BradHards
A good point. It's really just a feature for the end user, but different users might have different requirements. I will Google & see if I can find how other Fleet Management s/w does it.
What GPS device is it? most have current and average speed based from a location/waypoint. – Mapperz
This one does not, which is why I post the question. I have even asked the manufacturer who confirm their published API & indicate that they have no plans to introduce such a feature.