title: CLGeocoder geocoding is hopelessly inaccurate
body: <p>I have an App that does forward geocoding (get coordinates given address) to display a bunch of pins on an <code>MKMapView</code>. The app was developed well before iOS supported forward geocoding using <a href="http://developer.apple.com/library/ios/#documentation/CoreLocation/Reference/CLGeocoder_class/Reference/Reference.html"><code>CLGeocoder</code></a> (first available in iOS 5). As such my app uses the <a href="https://developers.google.com/maps/documentation/geocoding/?hl=en">Google Maps Geocoding API</a>, which is generally very accurate. Given a full address with a street number it will generally give you the exact location of that address within a couple of metres.</p>
  
  <p>I'm doing some updates to my App to support iOS 6 and decided to switch from using the Google API to using <code>CLGeocoder</code> provided the app was running on iOS 5 or above. However in my tests (all with addresses in Portugal, where I live) it is so inaccurate as to be totally unusable.</p>
  
  <p>I'm using <a href="http://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLGeocoder_class/Reference/Reference.html#//apple_ref/occ/instm/CLGeocoder/geocodeAddressString%3acompletionHandler%3a"><code>– geocodeAddressString:completionHandler:</code></a> and, for example, given the address "Avenida da Liberdade 195, Lisboa, Portugal" it gives me an "Avenida da Liberdade" in the city of Sintra, not Lisboa (Lisbon). That's about 15km away from the real address. Avenida da Liberdade is one of the biggest and most well known avenues in Lisbon. The equivalent of, say, 5th Avenue in NYC. It's not some obscure little side street.</p>
  
  <p>Is there anything I'm doing wrong to get such terrible accuracy? Are others having similar accuracy issues, especially with addresses outside the US?</p>
  
  <p>For the time being it looks like I'll have to stick with the Google Maps API. Incidentally, I've been using the iOS 6 simulator and there the results are no better. Putting the same search string into the search box on the iOS 6 Maps app gives the same totally inaccurate results.</p>
  
  <p><strong>EDIT:</strong> added <code>CLGeocoder</code>code:</p>
  
  <pre><code>    CLGeocoder *fgeo = [[[CLGeocoder alloc] init] autorelease];
      NSLog(@"Geocoding for Address: %@\n", address);
      [fgeo geocodeAddressString:address completionHandler:^(NSArray *placemarks, NSError *error) {
          if (!error) {
              // do stuff with the placemarks
  
              for (CLPlacemark *placemark in placemarks) {
                  NSLog(@"%@\n %.2f,%.2f",[placemark description], placemark.location.horizontalAccuracy, placemark.location.verticalAccuracy);
              }
          } else {
              NSLog(@"Geocoding error: %@", [error localizedDescription]);
          }
      }];
  </code></pre>
  
  <p><strong>EDIT 2</strong>: I've discovered that if I use <a href="http://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLGeocoder_class/Reference/Reference.html#//apple_ref/occ/instm/CLGeocoder/geocodeAddressDictionary%3acompletionHandler%3a"><code>– geocodeAddressDictionary:completionHandler:</code></a> and pass in an Address Dictionary with the street address, postal code (zip code) and as much detail as I can possibly provide, it gives me reasonably accurate coordinates, but still with an accuracy radius of more than 400m which is unacceptable.</p>