从时间轴中扩展Google位置记录

Ter*_*den 12 android google-maps geolocation google-latitude

请注意,由于Google"时间轴"的更改,此前的答案不再适用.


Google提供"时间线"服务,允许用户访问其手机的位置记录.

我想提取手机的当前位置.

如果我在时间轴中选择"今天",我可以"将这一天导出为KML"

在此输入图像描述

这包含我需要的数据,但我不知道如何以编程方式获取这些数据.我不想每次需要这些信息时都要登录网站.

它提供的网址是 -

https://doc-0uom0-1q5a8-s-googleusercontent.commondatastorage.googleapis.com/gs/[hash1]/[hash2]/1441116000000/takeout-eu/[user id]/[stupidly long hash]&nonce=[hash3]&user=[user id]&hash=[hash4]

除了Unix时间戳(1441116000000),我不知道如何计算该URL的参数.

谷歌地图API文档没有列出任何东西.

我希望能够wget使用URL来收集我的数据.有谁知道如何做到这一点?

Var*_*res 7

我相信这会给出最新的观点:

 https://www.google.com/maps/timeline/kml
Run Code Online (Sandbox Code Playgroud)


Ter*_*den 4

根据这个问题 - Current URL To Download KML Data From Google Location History? - URL 格式为:

例如 https://www.google.com/maps/timeline/kml?authuser=0&pb=!1m8!1m3!1i2015!2i7!3i1!2m3!1i2015!2i7!3i8 给出 7 天。

突出显示日期部分: pb=!1m8!1m3!1i 2015 !2i 7 !3i 8 !2m3!1i 2015 !2i 7 !3i 8

请注意,月份是从零开始的,因此与正常情况不同,0=一月,11=十二月

因此,为了获取今天的日期 (2015-09-01),URL 需要是

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

IE

pb=!1m8!1m3!1i YYYY !2i MM !3i DD !2m3!1i YYYY !2i MM !3i DD

其中MMJavascript 风格的从零开始的月份

在 KML 内,时间为美国西海岸 - 例如<when>2015-09-01T12:15:37.836-07:00</when>

因此,您的请求可能需要考虑到这一点。