iPhone 如何进行地理定位?

发布于 2024-08-13 06:36:29 字数 117 浏览 3 评论 0原文

iPhone已经有3代了,它们的地理定位机制是什么(WiFi,GPS,还有其他方式吗?)?最近在做iPhone开发所以想对这个有深入的了解。

(我想要所有定位方法的列表和具体介绍)

谢谢

Since there are 3 generations of iPhone, what's the mechanism of their geo locating(WiFi, GPS, any other ways?)? I am doing iPhone development recently so I want to make a deep understanding of this.

(I want a list of all methods of locating and a specific introduction)

Thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

感情洁癖 2024-08-20 06:36:29

iPhone/iPodTouch 非 GPS 地理定位引擎由 Skyhook Wireless 提供。他们使用地理定位货车在大多数城市的大部分道路上行驶,根据 GPS 绘制 wifi 点,iPhone 主要使用这些数据来进行修复。

有趣的是,Skyhook 使用 iPhone 来“自我修复”其接入点数据库。如果他们收到的点不在他们的数据库中,或者被认为在其他地方,他们就会完善数据。

我曾多次与 Skyhook 的 Kate Imbach 谈论过这项技术,令我惊讶的是他们没有将 GPS 与 WiFi 三角测量相结合来改进地图数据,但情况似乎并非如此。

也就是说,你的问题的具体方法部分是一个不同的故事:iPhone SDK 从你那里抽象了所有这些。
您只需将 CoreLocation 框架导入到您的项目中,采用 CLLocationManagerDelegate 协议,

然后实例化一个 Locationmanager,


    CLLocationManager * LM = [[CLLocationManager alloc] init];
    [[self locationManager] setDelegate:self];
    [[self locationManager] setDesiredAccuracy:kCLLocationAccuracyBest];    
    [[self locationManager] startUpdatingLocation];

然后您就可以查询您的 locationManager 或接收更新


- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation{
    NSLog(@"Location changed!");
}

- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error{
}

这应该可以让您开始!

The iPhone/iPodTouch non-gps geoLocation engine is provided by Skyhook Wireless . They have driven most roads in most cities with their geoLocation vans to plot wifi points against GPS and it is primarily this data that the iPhone uses to get its fixes.

Its also interesting to note that Skyhook uses the iPhone to "self heal" its access point database. If they receive a point which is not in their database, or thought to be elsewhere they refine the data.

I've spoken to a Kate Imbach of Skyhook about this technology a few times, and I'm surprised that they don't use GPS in combination with WiFi triangulation in order to improve mapping data, but it seems this is not the case.

That said, the specific methods part of your question is a different story: the iPhone SDK abstracts all of this from you.
You simply need to import the CoreLocation framework into your project, adopt the CLLocationManagerDelegate protocol

Then instantiate a Locationmanager


    CLLocationManager * LM = [[CLLocationManager alloc] init];
    [[self locationManager] setDelegate:self];
    [[self locationManager] setDesiredAccuracy:kCLLocationAccuracyBest];    
    [[self locationManager] startUpdatingLocation];

You can then query your locationManager or receive updates to


- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation{
    NSLog(@"Location changed!");
}

- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error{
}

That should get you going!

孤凫 2024-08-20 06:36:29

iPhone 3GS 通过 GPS、Wi-Fi 和蜂窝塔快速准确地找到您的位置。

通过 http://www.apple.com/iphone/iphone-3gs /maps-compass.html

iPhone 3GS finds your location quickly and accurately via GPS, Wi-Fi, and cellular towers.

via http://www.apple.com/iphone/iphone-3gs/maps-compass.html

沫雨熙 2024-08-20 06:36:29

Iphone可以使用GPS或WIFI(使用WIFI三角测量)来定位坐标。 WIFI 三角测量与 html5 地理定位 API 中使用的过程相同,更多有关 wifi 三角测量与 GPS 的信息 ( http://arstechnica.com/old/content/2008/01/where-gps-wont-do-wifi-triangulation-might.ars )

GPS 在地铁或拥挤区域的坐标锁定中可能会受到延迟的影响,但 WiFi 三角测量不会受到此影响并且相当准确。

简而言之,WIFI 三角测量的工作原理是 ISP 或地理定位服务提供商扫描某个区域并进行三角测量坐标。

Iphone can use GPS or WIFI (using WIFI triangulation) to locate coordinates. WIFI triangulation is the same process used in html5 geolocation API, more about wifi triangulation v/s GPS ( http://arstechnica.com/old/content/2008/01/where-gps-wont-do-wifi-triangulation-might.ars )

GPS can suffer from latency in coordinates lock down in a metro or crowded area, though wifi triangulation doesnt suffer from it and is fairly accurate.

Simply put WIFI triangulation works on the principle in which a ISP or geolocator service provder will sweep a area and triangulate coordinates.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文