Index: modules/geo_field/geo_field.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/geo/modules/geo_field/geo_field.module,v
retrieving revision 1.35
diff -u -p -r1.35 geo_field.module
--- modules/geo_field/geo_field.module	26 Apr 2010 05:40:43 -0000	1.35
+++ modules/geo_field/geo_field.module	22 Feb 2011 18:53:57 -0000
@@ -123,15 +123,20 @@ function geo_field($op, &$node, $field, 
       foreach ($items as $k => $item) {
         if(!geo_content_is_empty($item, $field)) {
 
-          // Convert to WKT (TODO we don't have direct-to-wkb functions yet!)
-          if ($gis_input) {
-            $wkt = geo_value($item['geo'], 'wkt', $gis_input);
+          if(!empty($item['wkb'])) {
+            $items[$k]['geo'] = db_result(db_query("SELECT GeomFromWKB(%b, %d)", $item['wkb'], $field['srid']));
+          }
+          else {
+            // Convert to WKT (TODO we don't have direct-to-wkb functions yet!)
+            if ($gis_input) {
+              $wkt = geo_value($item['geo'], 'wkt', $gis_input);
+            }
+            else $wkt = $item['geo'];
+
+            // Convert the WKT to binary data before the insert. This allows the
+            // input to pass through the binary query substitutions.
+            $items[$k]['geo'] = db_result(db_query("SELECT GeomFromText('%s', %d)", $wkt, $field['srid']));
           }
-          else $wkt = $item['geo'];
-
-          // Convert the WKT to binary data before the insert. This allows the
-          // input to pass through the binary query substitutions.
-          $items[$k]['geo'] = db_result(db_query("SELECT GeomFromText('%s', %d)", $wkt, $field['srid']));
         }
       }
       return;
