Feature request : Geotagging from Google Timeline file

Moderator: jsachs

Post Reply
pierrelabreche
Posts: 584
Joined: January 29th, 2019, 11:47 pm
What is the make/model of your primary camera?: Nikon Z8

Feature request : Geotagging from Google Timeline file

Post by pierrelabreche »

Google Timeline is a feature of Google Maps that records location history.
Google Maps users can download their location history in Google's format using the Android application Maps.

The format looks like this

Code: Select all

{
  "semanticSegments": [
    {
      "startTime": "2016-01-10T21:00:00.000-05:00",
      "endTime": "2016-01-10T23:00:00.000-05:00",
      "timelinePath": [
        {
          "point": "45.5229371°, -73.6889808°",
          "time": "2016-01-10T22:49:00.000-05:00"
        }
      ]
    },
    {
      "startTime": "2016-01-10T22:49:09.000-05:00",
      "endTime": "2016-01-11T08:25:39.000-05:00",
      "startTimeTimezoneUtcOffsetMinutes": -300,
      "endTimeTimezoneUtcOffsetMinutes": -300,
      "visit": {
        "hierarchyLevel": 0,
        "probability": 0.8199999928474426,
        "topCandidate": {
          "placeId": "ChIJt2gHDXAYyUwRHpluBZcL9eY",
          "semanticType": "HOME",
          "probability": 0.981173038482666,
          "placeLocation": {
            "latLng": "45.5230992°, -73.6889564°"
...
The request is to enable using Google timeline files directly as input to PWP's geotagging capability.

REFERENCE:
https://support.google.com/maps/thread/ ... line?hl=en
Android: Go to device Settings > Location > Location Services > Timeline > "Export Timeline data" button"
jsachs
Posts: 4448
Joined: January 22nd, 2009, 11:03 pm

Re: Feature request : Geotagging from Google Timeline file

Post by jsachs »

Geotagging is currently done via ExifTool. According to its documentation, ExifTool supports the following log formats:

GPX
NMEA (RMC, GGA, GLL and GSA sentences)
KML
IGC (glider format)
Garmin XML and TCX
Magellan eXplorist PMGNTRK
Honeywell PTNTHPR (see Orientation)
Bramor gEO log
Winplus Beacon .TXT
Google Takeout .JSON
GPS/IMU .CSV
DJI .CSV
ExifTool .CSV file

If the Google Timeline file is in one of these formats, it should be relatively easy to add support for it.
Jonathan Sachs
Digital Light & Color
pierrelabreche
Posts: 584
Joined: January 29th, 2019, 11:47 pm
What is the make/model of your primary camera?: Nikon Z8

Re: Feature request : Geotagging from Google Timeline file

Post by pierrelabreche »

Google timeline format is convertible to GPX

REFERENCE
https://github.com/Makeshit/Timeline-GP ... db0f71517a

README
Timeline-GPX-Exporter
Convert Google timeline new JSON format to daily GPX files

I created this because I needed an easy way to find time stamps from the last year of my raw timeline data, a function that irritatingly no longer exists since timeline went device only with the now very limited Android Maps Timeline interface.

Export timeline data from your Android device.

To do this, on your Android device go to settings > Location > Timeline > Export Timeline data.

Place the exported Timeline.json file into the same folder as Timeline-GPX-Exporter.py

Run Timeline-GPX-Exporter.py script. Daily GPX logs with be generated in ./GPX_Output with the format YYYY-MM-DD.gpx.

Open the GPX logs in your veiewer of choice. GPXsee is a gppd option, however you may need to disable Elimiate GPS outliers from settings > Data > Filtering and disable pause dectection from settings > Data > Pause Detection.

Example: Place both Timeline-GPX-Exporter.py and Timeline.json in C:/Timeline

Open command prompt
>cd C:\Timeline
>python Timeline-GPX-Exporter.py
The GPX log files produced are not perfect, some less forgiving viewers might regect them. However it does what I needed it to do perfectly, so as far as I'm concerned it's certified good enough. If this is good enough you then great, you're welcome, if it's not, well too bad, I have what I need from it and you're more than welcome to take it and adapt it to suit your needs.
pierrelabreche
Posts: 584
Joined: January 29th, 2019, 11:47 pm
What is the make/model of your primary camera?: Nikon Z8

Re: Feature request : Geotagging from Google Timeline file

Post by pierrelabreche »

PWP actually works using the Google Timeline file ( not a GPX file ) ! This is excellent.
The PWP interface was deceptive in that regard.
Post Reply