Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Current URL To Download KML Data From Google Location History?

I need to download google location history data in kml for a period of time.

Up until August 26, 2015, a URL in this format worked:

https://maps.google.com/locationhistory/b/0/kml?startTime=$start_seconds&endTime=$end_seconds  

Now a link in that format fails.

I suspect the problem is related to google changing the way its website displays location history, though that change happened nearly a month earlier on July 22.

A commenter on the google products forum suggested this:

[T]he KML generation can do multiple days, so just edit the URL

Eg https://www.google.com/maps/timeline/kml?authuser=0&pb=!1m8!1m3!1i2015!2i7!3i1!2m3!1i2015!2i7!3i8 gives 7 days.

Highlighting the parts of the date: pb=!1m8!1m3!1i2015!2i7!3i8!2m3!1i2015!2i7!3i8

Note the month is zero based, so one off normal, 0=Jan, 11=Dec

The commenter is wrong that the above link gives seven days. It appears to only give about three, but perhaps the commenter is on the right track.

I have tried different values for the fields in the commenter's URL that are not obvious date-related but have not been able to find a URL that returns a kml file with data for more that a few days.

I have several maps that use location history data, they are now all broken.

Edit: There's a similar question here: Extfiltrating Google Location History from Timeline

like image 633
Varanasi Benares Avatar asked Sep 01 '15 13:09

Varanasi Benares


People also ask

How do I download Google location History?

To download your data, head to Google Maps on your computer and sign in. Next, click the three-line menu icon in the top-left corner next to the Search box. Near the bottom, select “Your Data in Maps.” On the next screen, scroll down to and select “Download Your Maps Data.”


2 Answers

Go to https://takeout.google.com/settings/takeout and select only "Location History" with "KML format". Click "Next" and, then, "Create archive". After a while it will let you download a zip file with your (presumably entire) location history in KML format.

I tried and was able to download more than one year of my locations: I probably opted in the Location History service a little more than one year ago...

like image 193
stck0177 Avatar answered Sep 22 '22 07:09

stck0177


Undocumented changes to stable Google geo products are why I've been moving my personal and work projects from Google to open source products like Leaflet.

I've also been trying to figure how to get old-school location history kmls, but I'm not having any luck. The kml header information reflects that you have asked it to download a longer period of time, but it only actually includes placemarks for a few days.

A short term workaround is to download this app: https://play.google.com/store/apps/details?id=com.homedev.locationhistory

It's able to download 1-7 days of history, which you can then export as a kml. I'm not sure if the devs have cracked the url formatting or if they just loop through the short timespan data several times to make it look like it is downloading a week at a time.

like image 21
user2330576 Avatar answered Sep 19 '22 07:09

user2330576