views:

560

answers:

2

Does anyone have any suggestions on how to obtain the best horizontal accuracy on the location manager? I have set the desired accuracy to NearestTenMeters, but given that the accuracy can always change depending on coverage area, how can I write some code in the locationManager to stop updating only after I get the best horizontal accuracy?

A: 

Typically the longer the hardware is on and the more locations it gets the more accurate it gets. You can try turning on the manager early to let it get accurate and then grab the location. It also helps when the target is moving, the chip is able to get more accurate readings when gps is moving. Also the location of the device makes a diffrence, you will get much better reads if you are outside on a field than if you are in a bunker, so sometimes the read you get is the best thats available. Your code can wait till it gets no more updates from location manager for some time, then its probably at its best accuracy.

Daniel
A: 

If you want it to be to a certain accuracy, set the delegate method

- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation

to have

if(newLocation.horizontalAccuracy <= (some number) )
    [locationManager stopUpdatingLocation];

something like that.

marty