How iPhone knows where you are

This article was originally published on Macworld.com by Glenn Fleishman. He explains in very precise and didactic way location services of Apple iPhone and iPad and sheds light on the data that Apple gets on our devices. As sometimes a small dose of theoretical knowledge does not affect, I give you here the full translation. Take your time, it's quite long…

Apple uses GPS, Wi-Fi, and cell towers to get (and map) location data.

by Glenn Fleishman, Macworld.com 28 th 2011 16:00

iPhone users' experience with GPS is so fast, if instantaneous, that Apple's response on Wednesday to the subject of location on iOS could almost seem confusing :

Calculating a phone's location using only GPS satellite data can take up to several minutes. iPhone can reduce that time to seconds using Wi-Fi hotspots and cell phone antenna data to quickly find GPS satellites. ”

A few minutes ? Isn't my iPhone only taking a few seconds to find where I am ?

Well, oui… but only when he engages in a series of "tricks" to avoid a long process that was de rigueur when the first GPS receivers appeared. By simplifying things, Apple isn't entirely specific about how it all works and what it does. So let me explain where Wi-Fi and cell phone antennas fit into the equation.

12,5 minutes to locate

The first GPS receivers put 12,5 minutes from a cold start to lock a position. Other locations, after some time in the same region, could still take several minutes. If you had turned off a GPS receiver for several weeks or if you had moved a few hundred miles, A cold start might be necessary again.

GPS relies on two factors to create a set of precise coordinates of where you are standing : Time and space. GPS satellites broadcast precise time signals, using a built-in atomic clock, associated with their current position. They also broadcast the position of all other satellites in the sky, it is the ephemeris [of the constellation (*)].

All 30 seconds, a GPS satellite emits a timestamp, its current position as well as less precise position information for other GPS satellites. Needed 25 of these issues (therefore 12,5 minutes) for a complete list of satellite positions. This information must be decoded so that a receiver can then correctly interpret the signals from the satellites that are within range.

If you know the position of four satellites and the time each sent its position information, you, or rather your GPS receiver, can calculate at less than 10 meters latitude, the longitude and altitude of your current location with the exact time. With three satellites, You lose elevation, But a device can still track the movement quite accurately. Standalone GPS receivers can receive multiple satellites simultaneously, and follow more than four. Other techniques can also improve accuracy.

But, devil, I don't have 12,5 minutes. I'm a very busy man ! Give me this location faster !

Providing GPS support

Therefore, manufacturers of GPS chips and components have come up with a host of ways to shorten the waiting time, called assisted GPS (A-GPS). Instead of relying on live downloads of satellite positioning data, Future locations can be estimated with sufficient accuracy to determine the coarse positions of the satellites, and get a fix at every point where updated information is retrieved. These estimates can be downloaded via a network connection in seconds or even calculated directly to the receiver.

The time can also be used as an indicator. With a specific time, Partial satellite data can be decoded to achieve faster locking or retrieve appropriate information to use. In CDMA networks, such as that used by Verizon, GPS synchronized atomic time is required for basic network operations, which in fact makes this information available. (Actually, CDMA cell phone antennas incorporate GPS units to maintain better synchronization of atomic time.)

These additional functions are what makes GPS in A-GPS. Although many people misunderstand A-GPS and think it is a fake GPS system, This is not the case : A-GPS requires a GPS receiver to operate. Apple's iPhone and iPad 3G feature an A-GPS chip, like almost all GPS-equipped competing devices, especially Android phones. (A-GPS allows the use of much cheaper and simpler GPS circuits in phones, Reducing battery costs and leakage.)

This is where Apple's statement on Wednesday deviates from optimal accuracy. Apple Uses A-GPS for Native GPS Lock Enhancements, Wi-Fi network and the location of cellular antennas are additional factors providing a quick initial connection while improving GPS accuracy.

Cellular network providers have extremely accurate GPS measurement of the location of all their antennas. With a database of these antennas, You can take measurements of the signal strength of those within range of each other – which can be dozens – by trilateration in order to locate an overlapping zone between them. (The Trilateration uses the overlap of triangles to determine an area of intersection, the triangulation uses the measurement of angles and distances to determine a central point).

But cell phone antennas are too far apart to provide GPS-like accuracy, and they don't work well in less populated areas, even the suburbs, where coverage is less necessary than in an urban environment.

In search of Wi-Fi

Apple, Google and others are turning to Wi-Fi positioning for this. Wi-Fi positioning originally required vehicles specially equipped with Wi-Fi antennas and ultra-sensitive GPS receivers that circulated around cities to read network identifiers (the unique hardware address broadcast by the Wi-Fi base stations) and the relative signal strengths at billions of points. As with cell phone antennas, if you had enough networks and enough information about the signal strength, you could determine an approximate position.

It's very easy for a network device like a smartphone to take a snapshot of nearby Wi-Fi and cellular source data and transmit it to a server that responds with a rough set of coordinates. According to the Q&R from Apple, The company is taking it a step further by caching subsets of data on networks and proximity antennas to reduce network activity and speed up these queries. It also moves some calculations to the phone or tablet outside of location services. And that means that if there's no cellular or Wi-Fi connection available, This location information can already be useful. (This explains a mystery I saw in which a Wi-Fi iPad alone or iPod Touch can apparently calculate a location when it is out of the network).

Apple has, for the first time, unveiled Wi-Fi and cellular positioning with the original iPhone in an iPhone iOS update in early 2008. This was Apple's wipe out that the original iPhone didn't have a GPS receiver, which only started with the iPhone 3G.

You can see either of these features in action when you launch the Maps app. In general, You see a large blue circle appearing almost instantly, following what must be a consultation of the local database. The circle shrinks as more information is used, always from cellular and Wi-Fi sources, to create a better trilateration. This data is also used to provide more clues in decoding the best information from GPS satellites, allowing the use of very small fragments of data or even raw signals to achieve better locking. Finally, the circle becomes a simple dot when iOS is convinced that it has obtained a solid GPS lock. (**)

End of vehicles, Cloud Entry

Apple has given up Skyhook Wireless as a data provider from iOS 4.0 for iPod Touch and iPhone, and updating 3.2 for iPad alone. There's a reason for that. When your iOS device uses Wi-Fi positioning, it sends an overview of the common signals landscape to Apple, who says in the Q&R that this information is used anonymously for better quality data collected. But it's also an incredible source of useful marketing information, how often users rely on location updates, and where these users are grouped. It can be used for ad targeting and other purposes besides apps that seek location data.

Of course, the Q&Apple's R makes it clear that not all Wi-Fi snapshots are sent to Apple. Some algorithms control which ones are sent to improve the database. With the sources collected, Apple avoids having to send trucks on the road. Google has apparently taken the same approach, by using its vehicles Street View to supplement the sources collected by Android. (They encountered difficulties of two kinds in this regard. First of all, for apparently accidentally recording Wi-Fi network data in the clear, which resulted in fines, decisions and the cessation of this type of analysis in many countries. Secondly, for allegedly violently inducing two major manufacturers of telephone handsets to change their offerings to rely on Google data).

GPS is, in fact, The Science of Multistage Rockets. But the way Apple combines and complements information from multiple sources to create a fast and accurate lockdown is why for us, as users, it's "all GPS" and works perfectly.

Glenn Fleishman is a major contributor to Macworld, He writes regularly about wireless data. His latest book is "Take Control of iPhone and iPod touch Networking & Security, iOS 4 Publishing » (Take Control Ebooks).


(*) Translator's note.
(**) View article iPhone built-in GPS : some details

Share...