Is it possible to determine the Geolocation method used?

荒凉一梦 提交于 2019-12-11 07:51:33

问题


I am using CLLocationManager to get location updates in my app. Is there a way to determine what the GeoLocation method was? E.g. GPS, Triangulation, IP (Network).


回答1:


Not really. You can take a look at the horizontalAccuracy of a CLLocation object and hazard a guess based on its value, though:

  • < 25 meters: probably GPS
  • < 200 meters: probably Wi-Fi
  • anything greater: probably cell-tower triangulation

These values are just off the top of my head—to be most accurate you’ll probably want to do some experimentation yourself.

edit - also worth noting is that determining the device you’re running on can give you more information about which location provider is being used. For instance, first-gen iPhones had no GPS, so if you’re running on one of those then your location is definitely coming from either cell towers or Wi-Fi; no iPod model to date has supported anything other than Wi-Fi triangulation; and only the 3G model of the iPad has ever had cell-tower triangulation and GPS.



来源:https://stackoverflow.com/questions/9263744/is-it-possible-to-determine-the-geolocation-method-used

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