I've exported my geolocation history data as a JSON from Google Takeout and the latitude/longitude values are out of normal range sometimes. It seems to happen for some locations only, while others are normal and correct.

Here's a small extract of three dates with the invalid lat/long values and where I actually was at the time, is there some common transformation I need to use here that fixes this:

Date        lat         long        Location
13/01/2014  423.3738877 106.6510714 Jakarta, Indonesia (-6.23,106.76)
28/10/2015  397.6754516 115.7765074 Perth, Western Australia (-31.91,115.88)
8/08/2017   409.237868  372.8135318 Miranda, Brazil (-20.13, -56.88)

In the raw JSON file, the above three data points look like this (in the same order as listed above):

  "locations" : [ {
    "timestampMs" : "1389633689564",
    "latitudeE7" : 4233738877,
    "longitudeE7" : 1066510714,
    "accuracy" : 20
  }, {
    "timestampMs" : "1446040136103",
    "latitudeE7" : 3974349226,
    "longitudeE7" : 1157765074,
    "accuracy" : 1212
  }, {
    "timestampMs" : "1502203327757",
    "latitudeE7" : 4094251339,
    "longitudeE7" : 3728135318,
    "accuracy" : 16
  } ]

They seem to have an integer overflow error in preparing the data for the takeout (downloading the kml directly from google maps for a specific day works correct).

If the number is greater than 1800000000 (for latitude, also comparing to 900000000 would work) you need to subtract 2^32 (=4294967296) and you get the correct latitudeE7 or longitudeE7.

Your first example would be:

latitudeE7 = 4233738877 - 4294967296 = -61228419 (= 6.12 South)
longitudeE7 = 1066510714 (= 106.7 East, no conversion here)

  • This was an ugly one, thanks for figuring this out. Do you know if there is a bug report for this? – mariuss Apr 21 at 21:59
  • 1
    Not sure what is the best place to report this. I had asked a different question in their community help (support.google.com/maps/thread/3451335) a couple weeks ago, when takeout was not working at all for me, nobody replied to that one but that problem got fixed, but now showing the wrong numbers - I replied myself to the same comments to let them know in case somebody is reading those, but didn't bother to create a new thread for that. – gepa Apr 24 at 5:43
  • @gepa - Thank you for the solution. This must not be affecting everyone, based on the fact that there's hardly any chatter about this issue online. Also, I, too, would really like to know how to get a hold of Google when there's a legitimate, verified bug, like this. – ashleedawg Apr 26 at 23:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.