Just curious... iOS, finding a GPS fix, and teleportation

Discussion in 'iOS Programming' started by VulchR, Sep 5, 2011.

  1. VulchR macrumors 68020

    VulchR

    Joined:
    Jun 8, 2009
    Location:
    Scotland
    #1
    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.
     
  2. ianray macrumors 6502

    Joined:
    Jun 22, 2010
    Location:
    @
    #2
    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).

    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 :)
     
  3. VulchR thread starter macrumors 68020

    VulchR

    Joined:
    Jun 8, 2009
    Location:
    Scotland
    #3
    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' ...
     
  4. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #4
    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.
     
  5. ianray macrumors 6502

    Joined:
    Jun 22, 2010
    Location:
    @
    #5
    Thanks :) That's a good idea -- I will add it to the list of things to do...!
     

Share This Page