Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

VulchR

macrumors 68040
Original poster
Jun 8, 2009
3,578
14,628
Scotland
I am writing this because I am curious about how developers find a GPS fix in iOS - do they have to use a standard Apple algorithm or are developers free to create their own?

The reason why I ask is that I use a GPS map program to keep track of how much I walk for health & fitness. Yesterday I took a walk in rural Scotland and lost the GPS fix in a forest. However, once I had reached a clearing, the GPS was still searching for a fix. My location was shown as being at a phone mast nearly a mile away, and the circle indicating the uncertainty in my possible position did not include my actual position. Twenty minutes later the GPS was still searching. I put my phone into airplane mode (eliminating the phone mast as a potential position) and restarted my iPhone. Within 2 minutes or so the GOS fixed my location accurately. I presume whatever algorithm the app was using tried the phone mast location as the initial seed and then starting searching within the circle surrounding the mast for a location compatible with the GPS signals being received.

I found all of this surprising: the a priori probability of teleporting a mile to a phone mast when I had been walking on a steady heading at 3mph is pretty much zero. I was getting ready to blast the app for this issue, but realized that the it might arise from Apple's GPS routines. I just want to be fair in my review of the app, so if you know whether Apple constrains the GPS routines, then please post that fact here.
 
I am writing this because I am curious about how developers find a GPS fix in iOS - do they have to use a standard Apple algorithm or are developers free to create their own?

The CoreLocation component of iOS (and Mac OS X) provides standard interfaces for determining your location using GPS, Wi-Fi (crowd-sourced databases), or Cell Tower information.

CoreLocation hides the underlying technology from the programmer (though the API does, for example, allow the programmer to choose the desired accuracy).

the a priori probability of teleporting a mile to a phone mast when I had been walking on a steady heading at 3mph is pretty much zero.

Some GPS -based Apps -- including mine -- go to great lengths to filter and process the GPS measurements to avoid this kind of scenario!

Hope this clarifies things :)
 
Thank you for the reply. :)

I figured that this was an issue that might arise from Apple's GPS fixing algorithm. You'd think that some bright spark at Apple would incorporate the kinds of filtering algorithms you describe to eliminate false readings....

BTW: your app looks nice - have you considered putting in an estimate of kcal burned, running, cycling or walking? That is the primary reason I use the GPS when I walk. Just sayin' ...
 
You'd think that some bright spark at Apple would incorporate the kinds of filtering algorithms you describe to eliminate false readings....

You assume it's Apple's fault that you're getting a false reading when instead it's probably that the app developer is not interpreting the data correctly.
 
BTW: your app looks nice - have you considered putting in an estimate of kcal burned, running, cycling or walking? That is the primary reason I use the GPS when I walk. Just sayin' ...

Thanks :) That's a good idea -- I will add it to the list of things to do...!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.