Reputation: 3306
I am using CLLocationManager to get the location coordinate.
I using
- (void)locationManager:(CLLocationManager *)manager
didUpdateLocations:(NSArray *)locations{
[locations lastObject]
...
}
They can get the last location.
But I found if we get the lastObject at the initial.
The location is not really coordinate that will drift.
Over the some time, the coordinate will convergence the point.
But how can I know the value is really at the current place now?
thank you very much.
Upvotes: 1
Views: 60
Reputation: 3896
You can use the horizontalAccuracy
and verticalAccuracy
properties of your CLLocation
objects in order to know the precision of the measure.
According to Apple docs :
horizontalAccuracy :
The radius of uncertainty for the location, measured in meters. (read-only)
The location’s latitude and longitude identify the center of the circle, and this value indicates the radius of that circle. A negative value indicates that the location’s latitude and longitude are invalid.
verticalAccuracy :
The accuracy of the altitude value in meters. (read-only)
The value in the altitude property could be plus or minus the value indicated by this property. A negative value indicates that the altitude value is invalid.
Just wait for your horizontal value to decrease until a reasonable threshold in order to consider the coordinates exacts.
Upvotes: 1