本文介绍了地理围栏精度是否取决于locationManager的精度或距离过滤器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

地理围栏精度是否取决于locationManager的精度或距离过滤器?还是它们彼此独立,因为地理围栏由操作系统管理并使用Wifi /基站塔信息?

Is geofence accuracy dependent on locationManager’s accuracy or distance filter? Or they are independent of each other because geofence is managed by the OS and uses Wifi/Cell tower info?

例如:

locationManager

locationManager.distanceFilter = 1250;
locationManager.desiredAccuracy = kCLLocationAccuracyKilometer;

区域

let title = "Lorrenzillo's"
let coordinate = CLLocationCoordinate2DMake(37.703026, -121.759735)
let regionRadius = 550.0


let region = CLCircularRegion(center: CLLocationCoordinate2D(latitude: coordinate.latitude,
longitude: coordinate.longitude), radius: regionRadius, identifier: title)

550 (半径)小于 kCLLocationAccuracyKilometer 。 ..so地理围栏会按预期触发吗?

The 550 (radius) is less than kCLLocationAccuracyKilometer...so would the geofence trigger as expected?

据我了解, distanceFilter 对地理围栏没有影响准确性。
我不确定管理器的 desiredAccuracy 是否会影响地理围栏的准确性。

From what I understand the distanceFilter has no effect on the geofence’s accuracy.I’m just not sure if the desiredAccuracy of the manager would affect geofence’s accuracy.

推荐答案

这个问题没有道理;您正在比较苹果和老虎。地理围栏和您的应用程序的位置管理器完全没有关系。

The question makes no sense; you are comparing apples and tigers. Geofencing and your app's location manager have nothing at all to do with each other.

系统使用为您执行使用圆形区域的地理围栏 。您的位置经理不会进行与地理围栏相关的任何 定位。系统不使用您的应用程序的位置管理器或其设置,对此一无所知;确实,您的应用甚至可能不会运行。

Geofencing using a circular region is performed for you by the system. Your location manager doesn't do any geofence-related locating. The system does not use, and knows nothing of, your app's location manager or its settings; indeed, your app will probably not even be running.

(当然,您需要一个位置管理器才能拥有一个位置管理器委托,以便您可以接收当用户越过地理围栏边界但系统仍未进行任何与地理围栏相关的定位时,系统会进行回调。)

(You will, of course, need a location manager in order to have a location manager delegate so that you can receive callbacks from the system when the user crosses the geofence boundary, but your location manager is still not doing any locating related to geofencing.)

这篇关于地理围栏精度是否取决于locationManager的精度或距离过滤器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 10:09