Index: location.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/location/location.admin.inc,v
retrieving revision 1.17.2.3
diff -b -B -u -r1.17.2.3 location.admin.inc
--- location.admin.inc	17 Apr 2009 19:12:54 -0000	1.17.2.3
+++ location.admin.inc	13 Apr 2010 09:26:34 -0000
@@ -127,6 +127,13 @@
 function location_geocoding_options_form() {
   $form = array();
 
+  $form['location_geocode_google_minimum_accuracy'] = array(
+    '#type' => 'select',
+    '#title' => t('Google Maps geocoding minimum accuracy'),
+    '#options' => location_google_geocode_accuracy_codes(),
+    '#default_value' => variable_get('location_geocode_google_minimum_accuracy', '3'),
+    '#description' => t('The Google Maps geocoding API returns results with a given accuracy. Any responses below this minimum accuracy will be ignored. See a !accuracy_values_link.', array('!accuracy_values_link' => '<a href="http://code.google.com/apis/maps/documentation/reference.html#GGeoAddressAccuracy">description of these values</a>'))
+  );
   $form['countries'] = array();
 
   // First, we build two arrays to help us figure out on the fly whether a specific country is covered by a multi-country geocoder,
@@ -239,7 +246,7 @@
   $general_geocoders_in_use = array();
 
   foreach ($form_state['values'] as $key => $value) {
-    if (substr($key, 0, 17) == 'location_geocode_') {
+    if (substr($key, 0, 17) == 'location_geocode_'  && $key != 'location_geocode_google_minimum_accuracy') {
       if (in_array($value, $general_geocoders)) {
         $general_geocoders_in_use[$value] = $value;
         variable_set($key, $value);
@@ -247,6 +254,7 @@
     }
   }
 
+  variable_set('location_geocode_google_minimum_accuracy', $form_state['values']['location_geocode_google_minimum_accuracy']);
   variable_set('location_general_geocoders_in_use', $general_geocoders_in_use);
 }
 
@@ -272,6 +280,7 @@
 }
 
 function theme_location_geocoding_options(&$form) {
+  $output = drupal_render($form['location_geocode_google_minimum_accuracy']);
   $header = array(
     array('align' => 'center', 'data' => '<center>'. t('Country') .'</center>'),
     array('align' => 'center', 'data' => '<center>'. t('Options') .'</center>'),
@@ -291,7 +300,7 @@
     );
     $rows[] = $row;
   }
-  $output = theme('table', $header, $rows);
+  $output .= theme('table', $header, $rows);
   foreach (element_children($form) as $key) {
     $output .= drupal_render($form[$key]);
   }
Index: location.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/location/location.module,v
retrieving revision 1.222.2.31
diff -b -B -u -r1.222.2.31 location.module
--- location.module	11 Apr 2010 21:28:34 -0000	1.222.2.31
+++ location.module	13 Apr 2010 09:26:35 -0000
@@ -1726,3 +1726,22 @@
   require_once(drupal_get_path('module', 'location') .'/location.georss.inc');
   return _location_rss_item($location, $mode);
 }
+
+/**
+ * Returns a list of accuracy codes as defined by the Google Maps API.
+ * See http://code.google.com/apis/maps/documentation/reference.html#GGeoAddressAccuracy.
+ */
+function location_google_geocode_accuracy_codes() {
+  return array(
+    0 => t('Unknown location'),
+    1 => t('Country level accuracy'),
+    2 => t('Region (state, province, prefecture, etc.) level accuracy'),
+    3 => t('Sub-region (county, municipality, etc.) level accuracy'),
+    4 => t('Town (city, village) level accuracy'),
+    5 => t('Post code (zip code) level accuracy'),
+    6 => t('Street level accuracy'),
+    7 => t('Intersection level accuracy'),
+    8 => t('Address level accuracy'),
+    9 => t('Premise (building name, property name, shopping center, etc.) level accuracy'),
+  );
+}
Index: geocoding/google.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/location/geocoding/google.inc,v
retrieving revision 1.11.2.3
diff -b -B -u -r1.11.2.3 google.inc
--- geocoding/google.inc	29 Jun 2009 14:11:16 -0000	1.11.2.3
+++ geocoding/google.inc	13 Apr 2010 09:26:36 -0000
@@ -136,7 +136,7 @@
   $accuracy_code_match = array();
   preg_match('/Accuracy="([0-9])"/', $http_reply->data, $accuracy_code_match);
   $accuracy_code = $accuracy_code_match[1];
-  if ($accuracy_code < 3) {
+  if ($accuracy_code < variable_get('location_geocode_google_accuracy_code_'. $location['country'], variable_get('location_geocode_google_minimum_accuracy', '3'))) {
     return NULL;
   }
 
@@ -177,6 +177,16 @@
     );
   }
 
+  $country = arg(4);
+  if ($country) {
+    $form['location_geocode_google_accuracy_code_'. $country] = array(
+      '#type' => 'select',
+      '#title' => t('Google Maps Geocoding Accuracy for %country', array('%country' => $country ) ),
+      '#default_value' => variable_get('location_geocode_google_accuracy_code_'. $country, variable_get('location_geocode_google_minimum_accuracy', '3')),
+      '#options' => location_google_geocode_accuracy_codes(),
+      '#description' => t('The minimum required accuracy for the geolocation data to be saved.'),
+    );
+  }
   return $form;
 }
 
