Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

difference between desiredAccuracy and distanceFilter

Sorry for being a noob here. I am not able to clearly differentiate between CLLocationManager's properties distanceFilter and desiredAccuracy.

If I want my application to give different coordinates for even small distances (say 100-200 metres) what values should i set for these properties.

Help would be greatly appreciated.

like image 379
Neelesh Avatar asked Aug 08 '11 08:08

Neelesh


2 Answers

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

like image 96
Vlad Avatar answered Nov 06 '22 22:11

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.

like image 5
Serhii Mamontov Avatar answered Nov 06 '22 22:11

Serhii Mamontov