iPhone iOS4 Location Database

My good friend Chris Vance has been looking into the GPS data stored within iOS4 on the new iPhones. After pulling one of these databases from a phone, I have discovered that is nothing more than a SQLite3 database with a wealth of information*. I was tasked with making a visual representation of this data.

Digging in, I find two (very similar) tables: CellLocation and WifiLocation. In addition to the obvious Timestamp, Latitude, and Longitude fields (found in both tables), there are some other columns that could be interesting: HorizontalAccuracy, Altitude, VerticalAccuracy, Speed, Course, and Confidence. On the database that I had the opportunity to analyze, Confidence was the only one of these “interesting” fields that had values (integers) in it — and the values were meaningless to me without knowing what kind of rubric came up with that number. The “Timestamp” field used in these tables is a variation of the epoch timestamp — only instead of doing the number of seconds since 01/01/1970, Apple has chosen to use 01/01/2001. This makes the math pretty easy for converting to a human-readable date.

I chose to visualize these several thousand data points in Google Earth by generating a very basic KML file with Placemarks and Paths via Bash shell script.

I will post screenshots and (possibly) the script in the near future.

*SQLite Manager is a Firefox plugin that allows you to explore any SQLite database stored on your local computer. I found it very useful in digging into the file pulled from the phone.

Leave a comment

1 Comments.

  1. Would be very interested to see this.

Leave a Reply


[ Ctrl + Enter ]