Hello,<br><br>I originally posted this question re: "ogr geometry intersection" on gdal-dev, thinking that it had more to do with gdal/ogr, or a library therein, rather than with FWTools/Python wrapper.<br><br>Cheers,
<br>Jack<br><br>---------- Forwarded message ----------<span class="gmail_quote"><br>Date: Mar 22, 2007 4:00 PM<br>Subject: Re: ogr geometry intersection<br>To: <a href="mailto:gdal-dev@lists.maptools.org">gdal-dev@lists.maptools.org
</a><br><br></span>It
appears that the FWTools v1.0.9-and-earlier TopologyException is
limited to situations where one of the two polynomials being tested for
Intersection() is completely within the other. In other words, the
Intersection() test in "old" versions of FWTools/GDAL works--and works
"fast"--if the two polynomials actually intersect. So, my workaround
is to use FWTools v1.0.9 (or earlier) and condition any call to
Intersection() with Disjoint() or Contains() test(s). The question
remaining is: can FWTools v1.1.0+/GDAL revert back to the use of the
"old" and "fast" Intersection() code, adding in a test of
Disjoint()/Contains() to circumvent the TopologyException?
<span class="e" id="q_1117b3c47de3de3e_1"><br><br><div><span class="gmail_quote">On 3/21/07:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br><br>I
recently upgraded my FWTools (Win32) installation from v1.0.5 to
v1.2.2. Using v1.0.5, ogr geometry intersections would occasionally
raise a TopologyException in my Python application; e.g.:<br><br>Original exception: TopologyException: Area of intersection result is bigger then minimum area between input geometries
<br>Trying with Common bits remover.<br>CBR: TopologyException: Area of intersection result is bigger then minimum area between input geometries<br>Trying with precision 25<br>Reduced with precision (25): TopologyException: no outgoing dirEdge found -
71.6 40.88 40.8829<br>Trying with precision 24<br>Reduced with precision (24): TopologyException: no outgoing dirEdge found -71.5833 40.875 40.8829<br>Trying with precision 23<br><br>After
updating to FWTools v1.2.2 (gdal 1.4.0+svn to Feb. 22, 2007), I no
longer see TopologyExceptions from polygyon intersections in my Python
application -- but the performance has gone way down. Evaluation of
FWTools versions between 1.0.5 and 1.2.2 reveals that the
TopologyException fix + slow-down was introduced in v1.1.0:<br><br>P1.Intersection(P2), where P1=rectangle and P2=1860-point polygon<br>v1.0.9: ~0.01 seconds<br>v1.1.0: ~10.00 seconds (1000x slower)<br><br><sample program available>
<br><br>Is this a bug in GDAL, FWTools (Python wrapper), or an underlying library (GEOS)?
<br>Any ideas re: the slow-down and possible fix are appreciated.<br>
</blockquote></div></span>