Android:GPS coordinates are different in 3G and wifi

岁酱吖の 提交于 2019-12-13 05:40:57

问题


Might be a stupid question, but I don't know the logic behind.

  1. On a Wifi enabled device, GPS coordinates are accurate.(as expected)
  2. Disable Wifi and enable 3G gives a inaccurate coordinates (device location is same as in point 1.).

when a distance is calculated from coordinates in point 1. and 2. Google maps shows a 5min walking distance.

could someone explain the above behavior and is it possible to have same coordinates with 3G?.


回答1:


Android devices have three methods of calculating coordinates:

  1. GPS: This is the "fine" location and is the only one accurate.
  2. Wifi: Using a database of hotspots google collected when doing streetview.
  3. 3G: Using database of base stations and some very rough triangualtion.

So GPS coordinates are always expected to be accurate, but wifi coordinates are not and neither are 3g. Of course the cost of GPS precision is that it needs quite a lot of energy (a few phone batteries last more than 10 hours with GPS running) while wifi and 3g need no extra energy to what wifi/3g would use anyway.




回答2:


3g coordinates are taken from the 3g towers location (and probably triangulated from multiple towers). As a 3g cell can span several acres around the tower, the coordinate can only give you an approximation.

Also the device may just have cached an old location (especially when location updates come in via GPS and you don't need 3g). I've seen values several dozen miles away - especially when riding on the train and the 3g network handover does not allow for an easy position fix.



来源:https://stackoverflow.com/questions/5855262/androidgps-coordinates-are-different-in-3g-and-wifi

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