GPSBabel / gpsbabel

GPSBabel: convert, manipulate, and transfer data from GPS programs or GPS receivers. Open Source and supported on MacOS, Windows, Linux, and more. Pointy clicky GUI or a command line version...
https://www.gpsbabel.org
GNU General Public License v2.0
475 stars 126 forks source link

[feature request] Parsing of Google Takeout TimeLine records.json file #1264

Open TrueArgus13 opened 6 months ago

TrueArgus13 commented 6 months ago

Parsing of records.json file will provide detail waypoints from Google takeout timeline. It contains waypoints with additional info. As GPSBabel already suport other JSON files - it should be very simple to add it (it took about 10 minutes to wrote script in python). Input may be filtered by date, precision and source (usuallly - GPS/CELL or WIFI)

By the way, is there an option to include precision field in output GPX file?

tsteven4 commented 6 months ago

Support for reading google takeout timelines was added in 1.9.0: https://www.gpsbabel.org/htmldoc-1.9.0/fmt_googletakeout.html.

gpx has an option to change the precision of elevation values, but requires a source code change to alter the precision of other values such as latitude and longitude: https://www.gpsbabel.org/htmldoc-1.9.0/fmt_gpx.html

TrueArgus13 commented 6 months ago

Sorry, probably I was not clear enough. I'm talking not about "Semantic Location History" files which contains timeline objects only (actually - as we can see in TimeLine of Google web), but about raw waypoints, which contained in "Takeout\Location History (Timeline)\Records.json" file.

Example: { "locations": [{ "latitudeE7": 324564025, "longitudeE7": 350534863, "accuracy": 78, "altitude": 140, "verticalAccuracy": 16, "source": "WIFI", "deviceTag": 1664314150, "platformType": "ANDROID", "osLevel": 33, "serverTimestamp": "2023-11-24T00:08:40.526Z", "deviceTimestamp": "2023-11-24T00:08:40.071Z", "batteryCharging": true, "formFactor": "PHONE", "timestamp": "2023-11-24T00:00:12.137Z" }, { "latitudeE7": 324564025, "longitudeE7": 350534863, "accuracy": 100, "altitude": 140, "verticalAccuracy": 23, "source": "WIFI", "deviceTag": 1664314150, "platformType": "ANDROID", "osLevel": 33, "serverTimestamp": "2023-11-24T00:08:40.526Z", "deviceTimestamp": "2023-11-24T00:08:40.071Z", "batteryCharging": true, "formFactor": "PHONE", "timestamp": "2023-11-24T00:00:32.137Z" }, { ....

tsteven4 commented 6 months ago

We would entertain a pull request to support this.

A useful reference is https://locationhistoryformat.com/reference/

postmaxin commented 6 months ago

I implemented using the "Semantic Location History" folder first because it provides both waypoints and tracks, with trips being broken up intelligently, whereas "Records.json" appears to only provide one gigantic track, your all-time Google location tracking data. Just a track, no place names etc. We could include the Records.json data but there are a few challenges:

TrueArgus13 commented 6 months ago

@postmaxin Yes, sometime we need detailed tracks. For example, for geotaggign of photos taken by cameras. Timestamp filtering is required. "Accuracy" filter is nice-to-have too 😁 For awhile I just parse it to unicsv files (file-per-date) by simple python script and then combine and convert by GPSBabel.