<br><font size=2 face="sans-serif">Hi GEOS devels,</font>
<br>
<br><font size=2 face="sans-serif">We are writing a C++ application which
is looking for areas of overlap between 1000's &nbsp;of polygons. The app
is being</font>
<br><font size=2 face="sans-serif">developed on Linux with g++ 4.1.0.</font>
<br>
<br><font size=2 face="sans-serif">We first tried the stable release of
GEOS 2.2.3 and received this error after processing several polygons:</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; TopologyException: found
non-noded intersection between 87.9595 -40.3145, 87.9484 -40.2598 and 87.9857
-40.3126, 87.9575 -40.3146 87.9595 -40.3145</font>
<br>
<br><font size=2 face="sans-serif">While reviewing the list archives we
found references to major code changes that might fix some of these errors,
so we</font>
<br><font size=2 face="sans-serif">upgraded to RC3 and eventually to an
SVN version from 2007-09-18. We got through a lot more polygons without
errors,</font>
<br><font size=2 face="sans-serif">but finally received this error:</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; TopologyException: no
outgoing dirEdge found 87.957 -40.1615</font>
<br>
<br><font size=2 face="sans-serif">Note: this coordinate is from the first
segment of the second polygon of the first multi-polygon below.</font>
<br>
<br><font size=2 face="sans-serif">In the original code, before I converted
the multipolygons to strings to create the example, we received this error:</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; TopologyException: no
outgoing dirEdge found 87.7184 -40.3315</font>
<br>
<br><font size=2 face="sans-serif">Note: this coordinate is from the first
segment of the second multi-polygon below:</font>
<br>
<br><font size=2 face="sans-serif">I've boiled the error down to just a
few lines of code, and would appreciate any suggestions. &nbsp;The error
is thrown at the </font>
<br><font size=2 face="sans-serif">difference.</font>
<br>
<br><font size=2 face="sans-serif">Thanks<br>
Stuart<br>
</font>
<br>
<br>
<br><font size=2 face="sans-serif">#include &lt;string&gt;</font>
<br><font size=2 face="sans-serif">#include &lt;iostream&gt;</font>
<br>
<br><font size=2 face="sans-serif">#include &lt;geos/geom/PrecisionModel.h&gt;</font>
<br><font size=2 face="sans-serif">#include &lt;geos/geom/GeometryFactory.h&gt;</font>
<br><font size=2 face="sans-serif">#include &lt;geos/geom/Geometry.h&gt;</font>
<br><font size=2 face="sans-serif">#include &lt;geos/geom/MultiPolygon.h&gt;</font>
<br><font size=2 face="sans-serif">#include &lt;geos/io/WKTReader.h&gt;</font>
<br>
<br><font size=2 face="sans-serif">int main (int argc, char *argv[])</font>
<br><font size=2 face="sans-serif">{</font>
<br><font size=2 face="sans-serif">&nbsp; std::string mp1s = &quot;MULTIPOLYGON
(((88.0541300495810049 -40.3914336120775417,&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &quot; 88.0013586636740683
-40.3952580652168507,&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &quot; 87.9856522556763849
-40.3125682141688557,&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &quot; 88.0410955427405639
-40.3084853410231361,&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &quot; 88.0447770149226727
-40.3320733430391556,&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &quot; 88.0541300495810049
-40.3914336120775417)),&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &quot; ((87.9569549228361041
-40.1614847724049824,&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &quot; 87.9856522556763849
-40.3125682141688557,&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &quot; 87.9594803530699494
-40.3144955269957563,&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &quot; 87.9484023890450430
-40.2597855714132962,&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &quot; 87.9236385364479673
-40.1638760511710515,&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &quot; 87.9569549228361041
-40.1614847724049824)))&quot;;</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; std::string mp2s = &quot;MULTIPOLYGON
(((87.7184147523609425 -40.3314878875577705,&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &quot; 87.7106409229361930
-40.2916861830969211,&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &quot; 87.6363928113999862
-39.9074815079801084,&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &quot; 87.8588765594887349
-39.8933226300382628,&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &quot; 88.3245648150878964
-39.8616404104367064,&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &quot; 88.3252910982550503
-39.8653834273614933,&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &quot; 88.4058355104796334
-40.2774282017416283,&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &quot; 88.4066631207306273
-40.2815647501607259,&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &quot; 87.9574816223991007
-40.3146427145853394,&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &quot; 87.7184147523609425
-40.3314878875577705)))&quot;;</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; try {</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; geos::geom::PrecisionModel
*model = </font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; new geos::geom::PrecisionModel(geos::geom::PrecisionModel::FLOATING);</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; geos::geom::GeometryFactory
*factory = new geos::geom::GeometryFactory(model);</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; geos::io::WKTReader *wkt
= new geos::io::WKTReader();</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; geos::geom::MultiPolygon
*mp1 = (geos::geom::MultiPolygon *)wkt-&gt;read(mp1s);</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; geos::geom::MultiPolygon
*mp2 = (geos::geom::MultiPolygon *)wkt-&gt;read(mp2s);</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; std::cout &lt;&lt; &quot;Is
valid of one = &quot; &lt;&lt; mp1-&gt;isValid() &lt;&lt; std::endl;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; std::cout &lt;&lt; &quot;Is
valid of two = &quot; &lt;&lt; mp2-&gt;isValid() &lt;&lt; std::endl;</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; geos::geom::Geometry *diff
= mp1-&gt;difference(mp2); </font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; std::cout &lt;&lt; mp1-&gt;toString()
&lt;&lt; std::endl;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; std::cout &lt;&lt; mp2-&gt;toString()
&lt;&lt; std::endl;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; std::cout &lt;&lt; diff-&gt;toString()
&lt;&lt; std::endl;</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; }</font>
<br><font size=2 face="sans-serif">&nbsp; catch (std::exception const &amp;se)
{</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; std::cout &lt;&lt; &quot;ERROR
- &quot; &lt;&lt; se.what() &lt;&lt; std::endl;</font>
<br><font size=2 face="sans-serif">&nbsp; }</font>
<br><font size=2 face="sans-serif">&nbsp; catch (...) {</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; std::cout &lt;&lt; &quot;General
error&quot; &lt;&lt; std::endl;</font>
<br><font size=2 face="sans-serif">&nbsp; }</font>
<br>
<br><font size=2 face="sans-serif">}</font>