<span style="font-family: courier new,monospace;">Hi all</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">while searching for intersections between polygons (buildings), I have found shapes that make &quot;equals&quot; predicate crash. With simpler shapes, it occurs too :</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&gt;&gt;&gt; from shapely.geometry import Polygon</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&gt;&gt;&gt; p1 = Polygon(((0,0),(0,10),(10,10),(10,0),(8,0),(8,8),(2,8),(2,0)))</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&gt;&gt;&gt; p2 = Polygon(((2,0),(2,8),(8,8),(7,4),(8,0)))</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&gt;&gt;&gt; inter = p1.intersection(p2)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&gt;&gt;&gt; inter.is_valid and p1.is_valid and p2.is_valid</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">True</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&gt;&gt;&gt; inter.wkt</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&#39;GEOMETRYCOLLECTION (POINT (8.0000000000000000 0.0000000000000000), LINESTRING (8.0000000000000000 8.0000000000000000, 2.0000000000000000 8.0000000000000000), LINESTRING (2.0000000000000000 8.0000000000000000, 2.0000000000000000 0.0000000000000000))&#39;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&gt;&gt;&gt; inter.equals(p1)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">False</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&gt;&gt;&gt; inter.equals(p2)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Traceback (most recent call last):</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">  File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  File &quot;/usr/lib/python2.5/site-packages/Shapely-1.0.11-py2.5.egg/shapely/predicates.py&quot;, line 34, in __call__</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    return bool(self.fn(self.context._geom, other._geom))</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  File &quot;/usr/lib/python2.5/site-packages/Shapely-1.0.11-py2.5.egg/shapely/predicates.py&quot;, line 21, in errcheck</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    raise PredicateError, &quot;Failed to evaluate %s&quot; % repr(self.fn)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">shapely.geos.PredicateError: Failed to evaluate &lt;_FuncPtr object at 0x96a3bf4&gt;</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">I have got a Bus Error on MacOSX (libgeos version 3.0.0) and a Segmentation Fault on Ubuntu (libgeos version 3.0.3) with an equivalent code written in C (so I think Shapely is not involved).<br>
<br>Any idea ? Did I miss something ?<br></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Pascal</span><br style="font-family: courier new,monospace;">