Well, I was unable to reproduce because I was getting bus errors ;)

In case you missed some recent project news: what I've been calling  
1.1 is going to be 2.0. Aron Bierbaum is leading the work on a 1.2  
version that will make the most of GEOS 3.1 features while remaining  
backwards compatible. 2.0 is going to be late because I'm tied up with  
other work at ISAW for a few more weeks.

Cheers,

On Sep 18, 2009, at 1:28 PM, Mario Ceresa wrote:

> Hello Sean,
> thanks for your mail. Here I can reproduce every time. Sometimes when
> I try with the attached code, instead of throwing an exception, it
> segfaults in:
>
> #0  GEOSGeomTypeId_r (extHandle=0x21c2530, g1=0x1) at geos_ts_c.cpp: 
> 1191
> 1191                    return g1->getGeometryTypeId();
>
> If you need more information I'll be more than happy to help!
>
> A presto,
>
> Mario
>
> On Fri, Sep 18, 2009 at 12:59 PM, Sean Gillies  
> <[email protected]> wrote:
>>
>> On Sep 17, 2009, at 6:48 PM, Mario Ceresa wrote:
>>
>>> Hi everybody!
>>> I was curious to see new Shapely 1.1 in action and installed it in a
>>> virtualenv as explained in
>>>
>>> http://sgillies.net/blog/900/diving-into-shapely-1-1/
>>>
>>> but when I run the following code:
>>>
>>> from shapely.geometry import Point, Polygon
>>> from random import random
>>> spots = [Point(random()*2.0-0.5, random()*2.0-1.0).buffer(0.1) for i
>>> in xrange(200)]
>>> triangle = Polygon(((0.0, 0.0), (1.0, 1.0), (1.0, -1.0)))
>>> x = [s for s in spots if triangle.intersects(s)]
>>>
>>> I get:
>>>
>>> Traceback (most recent call last):
>>>  File "prepared.py", line 5, in <module>
>>>    x = [s for s in spots if triangle.intersects(s)]
>>>  File "Download/try-shapely/lib/python2.5/site-packages/
>>> Shapely-1.1a4-py2.5.egg/shapely/geometry/base.py",
>>> line 191, in intersects
>>>    return self._binaryGeometryPredicates.intersects(self, other)
>>>  File "Download/try-shapely/lib/python2.5/site-packages/
>>> shapely.geos-1.0a4-py2.5.egg/shapely/geos/predicates.py",
>>> line 63, in __call__
>>>    raise PredicateError, "Failed to evaluate %s in context %s and  
>>> %s"
>>> % (self.func.__name__, repr(context), repr(other))
>>> shapely.geos.PredicateError: Failed to evaluate GEOSIntersects_r in
>>> context <shapely.geometry.polygon.Polygon object at 0x19e2310> and
>>> <shapely.geometry.polygon.Polygon object at 0x19e25d0>
>>> Exception exceptions.AttributeError: "'NoneType' object has no
>>> attribute 'GEOSWKBWriter_destroy'" in <bound method
>>> GEOSWKBWriter.__del__ of <shapely.geos.wkb.GEOSWKBWriter object at
>>> 0x1a63750>> ignored
>>> Exception exceptions.AttributeError: "'NoneType' object has no
>>> attribute 'GEOSWKBReader_destroy'" in <bound method
>>> GEOSWKBReader.__del__ of <shapely.geos.wkb.GEOSWKBReader object at
>>> 0x1a636d0>> ignored
>>>
>>> Any idea on what I'm doing wrong? I use Geos 3.1.0 on a Fedora 10
>>> x64 system.
>>>
>>> Thanks and regards,
>>>
>>> Mario
>>
>> Hi Mario,
>>
>> GEOS is complaining that it can't intersect two geometries. It's
>> likely that there's a bug in shapely.geos, either in the code that
>> computes the GEOS geometry from the Python coordinate sequence  
>> arrays,
>> or in the caching of the geometry.
>>
>> I'm unable to reproduce the bug right now, but will look into it.
>>
>> Cheers,
>>
>> --
>> Sean
>>
>> _______________________________________________
>> Community mailing list
>> [email protected]
>> http://lists.gispython.org/mailman/listinfo/community
>>
> <prepared.py>_______________________________________________
> Community mailing list
> [email protected]
> http://lists.gispython.org/mailman/listinfo/community

--
Sean

_______________________________________________
Community mailing list
[email protected]
http://lists.gispython.org/mailman/listinfo/community

Reply via email to