它看起来像你可以标做的最好的是
[locationManager setDesiredAccuracy:kCLLocationAccuracyBest];
这篇帖子可能是一些使用iOS: get Accurate Reverse Geocoding using CLLocationManager?
另外值得一提的是,在地方布莱顿的运用波士顿仍然是一个有效的地址对于相同的位置。
http://support.apple.com/kb/HT1975
这为我工作:
- (void) resetLocationData{
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
[locationManager setDesiredAccuracy:kCLLocationAccuracyBest];
[locationManager startUpdatingLocation];
NSLog(@"LAT: %f", [locationManager location].coordinate.latitude);
NSString *latitude = [NSString stringWithFormat:@"%f", [locationManager location].coordinate.latitude];
NSString *longitude = [NSString stringWithFormat:@"%f", [locationManager location].coordinate.longitude];
NSString *latlong = [NSString stringWithFormat:@"%@,%@", latitude, longitude];
NSLog(@"LONG: %f", [locationManager location].coordinate.longitude);
NSLog(@"Combined Location: %@", latlong);
[[locationManager location]timestamp];
}
#pragma mark - CLLOCATION STUFF
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
self.currentLocation = newLocation;
CLGeocoder *geocoder = [[CLGeocoder alloc] init];
[geocoder reverseGeocodeLocation:self.currentLocation completionHandler:^(NSArray *placemarks, NSError *error)
{
NSLog(@"Placemark is %@", placemarks);
CLPlacemark *place = [placemarks objectAtIndex:0];
NSLog(@"placemark 0: %@", place);
// locationLabel.text = placemarks;
}];
if(newLocation.horizontalAccuracy <= 100.0f) {
[locationManager stopUpdatingLocation];
}
}
日志输出:
2013年1月13日23:23:05.508 CLLocationTest [47617:907]标为( “XX XXXXXX Rd,XX XXXXXX Rd,Brighton,MA 02135,United States @ < + 42.XXXXXX,-71.XXXXXXX> +/- 100.00m”
offhand,它看起来像locationManager可能使用更接近CLLocationAccuracy值。 – propstm
地标也有['subLocality'](http://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLPlacemark_class/Reference/Reference.html#//apple_ref/occ/instp/CLPlacemark/subLocality )属性,在可能的情况下,它包含更具体的信息,例如城市内的邻居/行政区/地区的名称 - 这可能是登录到控制台的“说明”所用的内容,这可以解释为什么您在布莱顿看到这个城市是波士顿。 – rickster
所以我认为会是这样,但subLocality给了另一个更具体的位置,而不是布赖顿或波士顿。我仍然没有找到'描述'从 – Jonathan