Exception: ParseException: Unknown WKB type 79 in GEOSWKBReader->readHEX() (line 318 of geofield/geofield.module)

this is on my startup screen and I cannot do anything else.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

deggertsen’s picture

I've run into the same issue. Did you ever find a solution?

deggertsen’s picture

For me this had something to do with a few incomplete Canadian addresses that were put into Address fields. Geofield threw this error instead of ignoring those addresses. It would be nice if there was a way to make Geofield simply ignore a bad address.

SocialNicheGuru’s picture

I agree with you, @deggersten

SocialNicheGuru’s picture

Quick fix:

 //sng
 try {
          $geom = $reader->readHEX($raw_geom[1]);
          $items[$id][$delta]['geom'] = $writer->write($geom);
 } catch (Exception $e) {
    echo 'Caught exception: ',  $e->getMessage(), "\n";
 }

//          $geom = $reader->readHEX($raw_geom[1]);
//          $items[$id][$delta]['geom'] = $writer->write($geom);
        }

Don't know what happens if $items[$id][$delta]['geom'] is not defined or NULL.

mtoscano’s picture

I have had this issue twice (Exception: ParseException: Unknown WKB type 49 in GEOSWKBReader->readHEX() (line 319...) and disabling GEOS solved the issue.
The error occur on node save and if I change the display format; if I disable GEOS and then unable it again I have no errors on node view.
I am using
PHP 5.5.7
PostgreSQL 9.1.11
PostGIS 1.5
GEOS 3.3.8

Geofield uses PostGIS as spatial backend.

mtoscano’s picture

BTW, in my case nothing to do with addresses at all, just two simple lines on an Openlayers map.
I wasn't able to apply the "quick fix" above.

mtoscano’s picture

If I switch the backend to Default Storage Backend I have no errors with GEOS enabled, so the problem seems to be related to WKT/WKB conversion with GEOS enabled and PostGIS backend.
This happened also on another machine with PostGIS 2.0.3

mtoscano’s picture

Additional information: during Feeds import nodes are created correctly with PostGIS backend and GEOS enabled, but the error occurs on first node view. Disabling/enabling GEOS and the following node view are fine.

mtoscano’s picture

GEOS incompatibility with PostGIS backend it is a big issue, as if you go with PostGIS it is also for performance but if you loose GEOS support performance decline, someone willing to have a look at this?
Thanks

jjchinquist’s picture

In regards to comment #8, that sounds like a caching error if you are disabling and enabling something. Mato, can you try a view + cache clear + view again?

Jan van Diepen’s picture

Issue summary: View changes
FileSize
890 bytes

I have the same issue.
I am not using PostGIS however.

The quick fix works for me and I am creating an install profile.
That means I need the patch to be available as a patch file.

So here's that patch file.

dobe’s picture

#11 patch worked for me.

hvalentim’s picture

+ 1 for working patch 11.
Using PostGIS 2.1

guillaumev’s picture

Status: Active » Reviewed & tested by the community

Same issue here, with geofield_postgis, and patch 11 fixed it. RTBC ?

Brandonian’s picture

Thanks for the patch, @Jan van Diepen! Committed to 7.x-2.x

http://drupalcode.org/project/geofield.git/commit/18076ae

Brandonian’s picture

Status: Reviewed & tested by the community » Fixed

Marking as fixed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.