Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I get the accuracy of GPS location in iOS?

I've seen Android developers get the accuracy of a GPS location. Is there a way that I can get the accuracy of my currenct GPS location in iOS?

I am using the code from this answer to get my location:

 locationManager = [[CLLocationManager alloc] init];
 locationManager.delegate = self;
 locationManager.distanceFilter = kCLDistanceFilterNone;
 locationManager.desiredAccuracy = kCLLocationAccuracyBest;
 [locationManager startUpdatingLocation];


 - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
     NSLog(@"OldLocation %f %f", oldLocation.coordinate.latitude, oldLocation.coordinate.longitude);
     NSLog(@"NewLocation %f %f", newLocation.coordinate.latitude, newLocation.coordinate.longitude);
 }
like image 454
SirRupertIII Avatar asked Jun 27 '13 07:06

SirRupertIII


1 Answers

There are 2 properties on the CLLocation -horizontalAccuracy and -verticalAccuracy. Most of times the accuracy is based on the hardware that you are using to get the location

like image 97
Andrea Avatar answered Sep 18 '22 15:09

Andrea