difference between desiredAccuracy and distanceFilter difference between desiredAccuracy and distanceFilter xcode xcode

difference between desiredAccuracy and distanceFilter


According to developer.apple.com

distanceFilter

The minimum distance (measured in meters) a device must move laterally before an update event is generated.

That means, based on previous location event, another location update will only be received after exceeding distanceFilter value distance.

desiredAccuracy refers to how accurate your location data should be. For example if you wish to see the exact street you're on you a high accuracy value for this parameter. (kCLLocationAccuracyBest)If you only wish to see the approximate area (such as in which neighbourhood you're in) you'd set a lower accuracy value for this param. (kCLLocationAccuracyThreeKilometers)

Choose this to suit your needs, however be aware that the more precise you wish to be and the more often you request updates, the more power it will drain from your device.

Hope this helps, Vlad


distanceFilter - this is minimal distance which device should pass from previous location which was passed to delegate with ...didUpdateToLocation:... method. And as soon as distance reached location service will invoke ...didUpdateToLocation... again and so on.

desiredAccuracy - tells to location service how accurate coordinate you want and this is minimal location error radius. If value is very low (ex. 5) radio will try to use GPS hardware and will keep powering it up hardly to make it give most accurate location. If value is large,than system may decide to use data which was retrieved from WiFi hotspots location triangulation.