How to convert long/lat integers from google history JSON to google map format?

萝らか妹 提交于 2021-02-05 09:38:10

问题


Google History JSON exporeted api return two integer for latitude and longitude, the file look like this:

{
  "locations" : [ {
    "timestampMs" : "1525631885005",
    "latitudeE7" : 511052047,
    "longitudeE7" : 207459413,
    "accuracy" : 16
  },
  ...
  ]
}

I have script that search through that JSON and I want to test if it find correct location, so how can I convert that numbers to values that can copy paste to google map web app to test?


回答1:


latitudeE7 and longitudeE7 are the latitude and longitude multiplied by 10e7 (10^7).

To get the latitude and longitude divide them by 10e7. That is latitude:51.1052047, longitude: 20.7459413

That would be "Bliżyn, Poland".



来源:https://stackoverflow.com/questions/50203799/how-to-convert-long-lat-integers-from-google-history-json-to-google-map-format

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!