New Google JSON format

Started by theSkyIScrape, August 23, 2024, 10:59:09 AM

Previous topic - Next topic

theSkyIScrape

It seems Google has recently changed their json format for the timeline. Just checking if there is a roadmap to implement this new file format. Thank you.
  {
    "endTime" : "2024-08-19T00:00:00.000Z",
    "startTime" : "2024-08-18T22:00:00.000Z",
    "timelinePath" : [
      {
        "point" : "geo:51.512071,-0.127062",
        "durationMinutesOffsetFromStartTime" : "9"
      },
      {
        "point" : "geo:51.512892,-0.121467",
        "durationMinutesOffsetFromStartTime" : "10"
      },
      {
        "point" : "geo:51.504762,-0.113110",
        "durationMinutesOffsetFromStartTime" : "14"
      },
      {
        "point" : "geo:51.504494,-0.113642",
        "durationMinutesOffsetFromStartTime" : "15"
      },
      {
        "point" : "geo:51.502871,-0.117404",
        "durationMinutesOffsetFromStartTime" : "16"
      },
      {
        "point" : "geo:51.502824,-0.117905",
        "durationMinutesOffsetFromStartTime" : "20"
      },
      {
        "point" : "geo:51.503479,-0.118467",
        "durationMinutesOffsetFromStartTime" : "81"
      },
      {
        "point" : "geo:51.503186,-0.118141",
        "durationMinutesOffsetFromStartTime" : "83"
      },
      {
        "point" : "geo:51.503026,-0.118639",
        "durationMinutesOffsetFromStartTime" : "108"
      },
      {
        "point" : "geo:51.502818,-0.117925",
        "durationMinutesOffsetFromStartTime" : "114"
      }
    ]
  },

StarGeek

Quote from: theSkyIScrape on August 23, 2024, 10:59:09 AMIt seems Google has recently changed their json format for the timeline. Just checking if there is a roadmap to implement this new file format.

Exiftool treats all JSON files the same way. There isn't any special handling of previous Google JSON files.

Just run the command in FAQ #3 directly on the JSON file to see what data exiftool will extract.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

theSkyIScrape

Thank you. When I run using this new json file I am getting this - No track points found in GPS file './location-history.json' in File:Geotag (ValueConvInv)

Phil Harvey

Right.  The -geotag option.  I'll have to add support for the new syntax

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

theSkyIScrape

Quote from: Phil Harvey on August 23, 2024, 12:01:49 PMRight.  The -geotag option.  I'll have to add support for the new syntax

- Phil

Thank you Phil.

Phil Harvey

I've got this working and ExifTool 12.94 should have the ability to geotag from these files.  I hope to release this version within a few days.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

theSkyIScrape

Quote from: Phil Harvey on August 28, 2024, 09:13:36 AMI've got this working and ExifTool 12.94 should have the ability to geotag from these files.  I hope to release this version within a few days.

- Phil

Thank you Phil. Eager to test it when you release.

theSkyIScrape

Quote from: Phil Harvey on August 28, 2024, 09:13:36 AMI've got this working and ExifTool 12.94 should have the ability to geotag from these files.  I hope to release this version within a few days.

- Phil

I am getting the same error. Is there something wrong with my syntax.

Command - exiftool -P -geotag 'location-history.'json '-geotime<${CreateDate}+01:00' *.CR3

Error - No track points found in GPS file 'location-history.json' in File:Geotag (ValueConvInv)
        No writable tags set from 2024-08-Ireland-0001.CR3

Phil Harvey

Could you attach the json file so I can try this out?  It works for me if I use the JSON from your first post, so something must be different.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

theSkyIScrape

Quote from: Phil Harvey on August 31, 2024, 09:12:51 PMCould you attach the json file so I can try this out?  It works for me if I use the JSON from your first post, so something must be different.

- Phil

There are some square braces at the start and end. Please check your email that you have in your readme file. I have explained why I couldn't attach it here.

Phil Harvey

The problem was due to the fact that the GPS came much later in this file and ExifTool only parses the first 50 lines of the file to determine its type.  I've patched 12.96 to key on some information that comes earlier in this file, and it should solve the problem for now.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

theSkyIScrape

Quote from: Phil Harvey on September 01, 2024, 02:18:04 PMThe problem was due to the fact that the GPS came much later in this file and ExifTool only parses the first 50 lines of the file to determine its type.  I've patched 12.96 to key on some information that comes earlier in this file, and it should solve the problem for now.

- Phil

Wohooo it worked. Thank you so much.

silentknight

Looks like Google may have changed the format again. My timeline.json file (attached) has timelinePath in a different format to the OP:
"timelinePath": [
        {
          "point": "55.5943257°, 13.0008045°",
          "time": "2024-05-08T17:10:00.000+01:00"
        }, ...
and ExifTool only recognises 1 point in the file.

Possibly related: I generated this file using "Export Timeline data" in "Location Services" on my Android phone. Seems Google is moving timeline data storage from server to phone: for me Google Takeout no longer includes a timeline.json file.

Phil Harvey

ExifTool 13.02 will handle this new format.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).