I am considering building an iPhone GPS app to assist runners. It would need to get an accurate speed reading (within 1mph) every 10 seconds. Is the iPhone 3GS or the new iPhone 4 capable of giving a reading this accurate?


Doubtful over time. Maybe for a few cycles. But between sleep, GPS lag, and accuracy issues I think it will be challenging. It's also worth asking how many people run with their iPhone?

Jason McCreary
The same people who used to run with their ipod now run with their iphone.
Fair. I just personally wouldn't as a runner. It's worth noting that this type of app comes with challenges, both technical and marketing. That's what Gattster was asking.
Jason McCreary
Ty I appreciate all the comments even about the market.
Jason, I run and cycle with my nexus one using the endomondo app and it works just fine at telling me speed and distance. It is crazy accurate which would indicate that it is constantly getting gps coordinates. And having played a little with the iphone getting gps and judging distance, i can tell you that you can get fairly accurate results. And it seemed like half the people in a half marathon i recently ran had their iphones on them (There were 23,000 people in that race)
Offtopic, but it wouldn't happen to have been the Huntington beach Marathon?
I never said *impossible*. I said *challenging*. I have made several apps dealing with CoreLocation and MapKit for the iPhone. There are many variables with gathering GPS data. Personally, I'd be reluctant to develop and market an app where the core function relied on incredibly accurate GPS data. Say for example, charting a runners route with statistical data. I've thought about building such an app, and I felt I couldn't reliably meet the user's expectations. I am not trying to be the *nay sayer* here. So don't let my feedback stop you.
Jason McCreary
@gattster no it was the oklahoma city memorial marathon.
+2  A: 

It's possible but you couldn't depend on it 100% because of the possible inaccuracies of the gps. And your timing would need to be such that it's gaugeing on straight line distances so 10 seconds apart might work but you could also capture a point every second or two then figure the distance between all the points in that 10 second spread and use that against the starting timestamp and ending timestamp. Best option is to put something together and test it.

+3  A: 

In terms of accuracy it's possible (as long you don't lose the signal of course). Especially since GPS is much more accurate in relative positioning (i.e. it might have 10m uncertainty in positioning you on the map, but it'll detect it if you move for 1m). For periods that there's no signal, you'll just get an average velocity or something.

However note that leaving the GPS on like this will dramatically eat up the battery so it might not be very satisfactory for your customers if used for a long period.

You might want to use other technologies or ask for the user's assistance and use the GPS less often. For example, you could sample the location every minute or so, and then use the map API to guess how the user moved from A to B (or ask the user if it's not possible).


You may be better off counting shake events as each shake will correspond to a foot-strike. Then use the GPS as a means of calibrating the runners average stride length every 10 seconds or so. Over time, you may be able to correlate frequency of foot-strikes and GPS data with the average stride length. I would expect a more tired runner to use a shorter stride and fewer foot-strikes per second.

John Franklin
+1  A: 

Does the iphone have an accelerometer? You could do it that way. Also, there is a very similar app that I personally use that works very well, but it's not for iphone due to various OS limitations.


+1  A: 

Yes, is probably the short answer. Download a similar app like Trails Lite to test it for your needs.

If you average your location samples over 10 seconds then you will end up with a pretty accurate speed reading. Think of it like the needle of a speedometer in an old car, bouncing around with every pothole. If you look at it for a split-second, then you can't tell what speed you're doing, but if you study it for 10 seconds (and I don't recommend trying this) you can get a much better idea.

As has already been pointed out, the accuracy of absolute positioning may only be accurate to 40m or so, but relative positioning is much more accurate, and that's what you need.


As some people have noted, you'll run into the problem of spots in service. This can be accounted for, though I wouldn't call it fixed, by keeping track of their average speed for the past minute/few minutes and apply that to the "gray zone."

This keeps them moving forward at what can be somewhat safely assumed as their current speed, as long as they're not stopping and starting often. This fallback number can be kept up to date and swapped for the realtime number in instances where service isn't available, and then swapped out again when service comes back. You could possibly incorporate the accelerometer to make sure they're still running when the fallback number is being shown.

Sean O'Hollaren