Peter Zion, 7 January 2009
I was recently talking with someone about what was possible with the location discovery support on the iPhone, and it became clear that I needed to explain exactly what the iPhone is doing when you ask for its location. I’m cross-posting here for future reference.
Here’s how the iPhone obtains its location: it has three different ways of figuring out where it is, and it basically tries all three at the same time and sends you updates if it has a more accurate estimate of the location.
The first way it discovers its location, of course, is the GPS. The GPS is very accurate (it can get down to within a few meters if it’s outdoors and the weather is clear), but it takes a relatively long time to obtain the location (though usually still less than 10 seconds).
The second way is by triangulation based on the cell towers it can talk to. This accuracy of this method depends on how many cell towers are near you; for one of my colleagues, it’s fairly accurate (within 100m) but for me it’s accurate to only within 2000m or so.
The third method is through wifi; I’m not 100% sure how it works, but certain wifi providers also provide geographic coordinates of where the routers are approximately located. Presumably they do this somehow by knowing, for instance, where the DSL line terminates. Thus, when you’re connected by Wifi you have additional information about where you’re located, possibly fairly accurate.
Note that the first generation iPhone, which doesn’t have a GPS, still tries to obtain its location using the second and third methods.
All of this is transparent to any iPhone application: you simply ask it to start telling you the location, and it will do so and continue to update you as it gets better estimates or the phone moves a significant distance. The application has no control over the way the phone obtains its location.
The bad news is that there’s nothing you can do to guarantee that the iPhone will be able to obtain its location while indoors. It’s not possible; the technology simply isn’t there, not just for the iPhone but for any consumer device.
The good news is that the GPS often works even if you are indoors, as long as you’re reasonably close to a window. For instance, it works fine from my office, even though the window is about 15 feet away.
5 Comments »