You must first retrieve the file consolidated.db located in the directory /private/var/root/Library/Caches/locationd . This requires a jailbroken iPhone and an SSH connection (to retrieve the file via sftp) or an utility like Iphone Folders.
Update: you can also get this file from an non-jailbroken iPhone using a backup made by iTunes and a tool like "iphonebackupextractor". Choose "expert mode" and extract the file "consolidated.db" located in Library/Caches/locationd. Thus, even an non-jailbroken iPhone may reveal where you went!
This file is a Sqlite3 database that contains the table CellLocation . This table contains the following fields:
MCC-
MNC -
LAC -
CI -
TimestampDate and time of acquisition in seconds since 1 January 2001 (GMT); -
LatitudeLatitude of the point; -
LongitudeLongitude of the point; -
HorizontalAccuracyLocation accuracy - 1 if the location is invalid); -
AltitudeAltitude (not provided in the examples recovered); -
VerticalAccuracy -
SpeedSpeed (not provided in the examples collected) -
Course -
Confidence -
PRIMARY -
MNC -
LAC -
CI
It’s relatively easy to draw the data on a map to get an idea of places visited by the owner of the iPhone (careful, it gives an indication of the location, but the accuracy may be misleading, however, the multiplication points in a given area can be quite revealing).
Here is a demonstration that shows the most recent valid points. Default display is a basic example, but you can upload your own data file ...