shapely and geos break in distance method
Question: I'm having problems using the distance method in shapely (I suspect
incompatibility with the geos package).

The following code:

    
    
    from shapely.geometry import Point
    print Point(0,0).distance(Point(1,1))
    

creates the following error:

    
    
    python: GeometryComponentFilter.cpp:34: virtual void geos::geom::GeometryComponentFilter::filter_ro(const geos::geom::Geometry*): Assertion `0' failed.
    Aborted (core dumped)
    

I’m running CentOS 6, python 2.6, geos 3.4.2 (although it creates a link from
libgeos_c to 1.8.2)

Googling it yielded a few old posts which didn't really help me.

Thanks, Raz


Answer: This looks like a GEOS bug ([#535](http://trac.osgeo.org/geos/ticket/535)). As
a work around, try fetching a development snapshot [that appears to solve this
issue](http://trac.osgeo.org/geos/changeset/3960):

    
    
    svn co http://svn.osgeo.org/geos/trunk@3960 geos-svn
    cd geos-svn
    ./autogen.sh
    ./configure
    make
    make check
    

If the last command throws any similar errors, consider contributing feedback
to the bug report. But if all is good, then it should be good for shapely. As
root:

    
    
    make install
    ldconfig
    

