Index: includes/handlers/geo_simple.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/geo/includes/handlers/geo_simple.inc,v
retrieving revision 1.7
diff -u -p -r1.7 geo_simple.inc
--- includes/handlers/geo_simple.inc	26 Apr 2010 05:40:43 -0000	1.7
+++ includes/handlers/geo_simple.inc	14 Jun 2010 10:03:45 -0000
@@ -24,10 +24,10 @@ class GeoSimple implements GeoInterface 
       GEO_TYPE_POINT => 'point',
       GEO_TYPE_LINESTRING => 'linestring',
       GEO_TYPE_POLYGON => 'polygon',
-      GEO_TYPE_COLLECTION => 'collection',
+      GEO_TYPE_COLLECTION => 'geometryCollection',
       GEO_TYPE_MULTIPOINT => 'multipoint',
-      GEO_TYPE_MULTILINESTRING => 'multilinestring',
-      GEO_TYPE_MULTIPOLYGON => 'multipolygon',
+      GEO_TYPE_MULTILINESTRING => 'multiLinestring',
+      GEO_TYPE_MULTIPOLYGON => 'multiPolygon',
     );
     if (!is_null($value)) {
       if (is_numeric($value)) return $types[$value];
@@ -121,14 +121,16 @@ class GeoSimple implements GeoInterface 
   }
 
   public function geomFromText($wkt, $srid = GEO_SRID_DEFAULT, $type = NULL) {
-    preg_match('/^\s*(\D+)\W/Ui', $wkt, $m);
-    if (defined('GEO_TYPE_'. ($name = strtoupper($m[1])))) {
+    preg_match('/^\s*(\D+)\W/Ui', $wkt, $m); // TODO: check for actual match !
+    $name = strtoupper($m[1]);
+    if ( $name == 'GEOMETRYCOLLECTION' ) $name = 'COLLECTION';
+    if (defined('GEO_TYPE_'. $name)) {
       $geo_type = constant('GEO_TYPE_'. $name);
     }
 
     // Can't determine the geo_type from this WKT string.
     else {
-      return $this->error(t('Invalid text'));
+      return $this->error(t('GeoSimple:::geomFromText: could not determine type of geometry defined by WKT string "%wkt"', array('%wkt' => $wkt)));
     }
 
     // A specific geometry type is being requested, but it's not in the WKT.
@@ -718,7 +720,11 @@ class GeoSimple implements GeoInterface 
   public function parseWKB($g, $format = NULL) {
     $format = strtolower($format);
     if (isset($g->$format)) return $g->$format;
-    $result = geo_wkb_get_data($g->asBinary(), $format);
-    return $g->$format = $result['value'];
+    if (method_exists($g, 'asBinary')) {
+      $result = geo_wkb_get_data($g->asBinary(), $format);
+      return $g->$format = $result['value'];
+    }
+    
+    return NULL;
   }
 }
