? accuracyvariable.patch
Index: location.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/location/location.install,v
retrieving revision 1.41.2.1
diff -u -p -r1.41.2.1 location.install
--- location.install	25 Feb 2009 18:49:30 -0000	1.41.2.1
+++ location.install	26 Jun 2009 20:33:51 -0000
@@ -24,6 +24,7 @@ function location_uninstall() {
   variable_del('location_display_location');
   variable_del('location_usegmap');
   variable_del('location_locpick_macro');
+  variable_del('location_geocode_google_minimum_accuracy');
 
   // Delete geocoder settings.
   $result = db_query("SELECT name FROM {variable} WHERE name LIKE 'location_geocode_%'");
Index: geocoding/google.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/location/geocoding/google.inc,v
retrieving revision 1.11.2.2
diff -u -p -r1.11.2.2 google.inc
--- geocoding/google.inc	9 Jan 2009 18:36:48 -0000	1.11.2.2
+++ geocoding/google.inc	26 Jun 2009 20:33:51 -0000
@@ -134,7 +134,7 @@ function google_geocode_location($locati
   $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 < get_variable('location_geocode_google_minimum_accuracy', '3')) {
     return NULL;
   }
 
@@ -175,6 +175,25 @@ function google_geocode_settings() {
     );
   }
 
+  $form['location_geocode_google_minimum_accuracy'] = array(
+    '#type' => 'select',
+    '#title' => t('Google Maps geocoding minimum accuracy'),
+    '#options' => array(
+      '0' => t('0 - Unknown location.'),
+      '1' => t('1 - Country level accuracy.'),
+      '2' => t('2 - Region (state, province, prefecture, etc.) level accuracy.'),
+      '3' => t('3 - Sub-region (county, municipality, etc.) level accuracy.'),
+      '4' => t('4 - Town (city, village) level accuracy.'),
+      '5' => t('5 - Post code (zip code) level accuracy.'),
+      '6' => t('6 - Street level accuracy.'),
+      '7' => t('7 - Intersection level accuracy.'),
+      '8' => t('8 - Address level accuracy.'),
+      '9' => t('9 - Premise (building name, property name, shopping center, etc.) level accuracy.'),
+    ),
+    '#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>'))
+  );
+
   return $form;
 }
 
