CLGeocoder's geocodeAddressString: misses places outside the US
| Originator: | carlos.fonseca | ||
| Number: | rdar://11515239 | Date Originated: | 23-May-2012 05:19 PM |
| Status: | Open | Resolved: | |
| Product: | iPhone SDK | Product Version: | 5, 6 |
| Classification: | Serious Bug | Reproducible: | yes |
This problem is duplicate of 11385190 - Open
I'm finding that geocodeAddressString: consistently returns places with some error when outside of the US. Searching for some US cities dropped the pin just fine but cities in Europe have some error margin and Apple's Maps.app does not show this problem.
The value of the error varies.
Steps to Reproduce:
Build an app with a map and request locations like Faro, Sheffield, Porto, Alhambra and others using
[geocoder geocodeAddressString:searchBar.text
completionHandler:^(NSArray* placemarks, NSError* error){
MKPointAnnotation * aPoint = nil;
for (CLPlacemark* aPlacemark in placemarks) {
MKPlacemark *pa = [[MKPlacemark alloc] initWithPlacemark:aPlacemark];
[map addAnnotation:pa];
}
}];
Expected Results:
The pins should drop on the place typed, like they do on Apple's Map.app
porto (Portugal): 41.14996, -8.61023
faro (Portugal): 37.015359, -7.935112
…
Actual Results:
The pins drop far away from the named place. How far is variable.
porto: 41.226979, -8.360622
faro: 37.235423, -8.143467
…
Regression:
I've reproduced it on a 3GS iOS 5.0.1, up to an iPhone 4 iOS 5.1.1 and on the Simulator.
Notes:
I've posted this also on https://devforums.apple.com/thread/151973?tstart=0
On the attached screenshot my app is the one with the red UI, the blue one is Apple's Maps.app
…
I have attached a sample project.
This code displays a red pin for the apple results and a green pin for google results with any location search.
I've added a few buttons on the bottom for some examples of large discrepancy between google results (mostly correct) and CLGeocoder ones in Portugal.
I've first found this on iOS5, where the location of "Faro" is way too far from its location but now I see that the problem has blown out of proportion with iOS6 (only tested on beta 3) with every location that I included being much farther away than before! Even Lisboa, the capital of the country, is about 30~40KM away.
Please run on the two OS's and check the differences.
Apps from the App Store and the Maps.app are also behaving like this.
On iOS5 my problem was mostly with the Maps.app displaying correct results and CLGeocoder being wrong but i guess the underlaying systems have been uniformed, making the problem more system wide.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!