<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 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"> 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"> 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"> 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. 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 <string></font>
<br><font size=2 face="sans-serif">#include <iostream></font>
<br>
<br><font size=2 face="sans-serif">#include <geos/geom/PrecisionModel.h></font>
<br><font size=2 face="sans-serif">#include <geos/geom/GeometryFactory.h></font>
<br><font size=2 face="sans-serif">#include <geos/geom/Geometry.h></font>
<br><font size=2 face="sans-serif">#include <geos/geom/MultiPolygon.h></font>
<br><font size=2 face="sans-serif">#include <geos/io/WKTReader.h></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"> std::string mp1s = "MULTIPOLYGON
(((88.0541300495810049 -40.3914336120775417,"</font>
<br><font size=2 face="sans-serif"> " 88.0013586636740683
-40.3952580652168507,"</font>
<br><font size=2 face="sans-serif"> " 87.9856522556763849
-40.3125682141688557,"</font>
<br><font size=2 face="sans-serif"> " 88.0410955427405639
-40.3084853410231361,"</font>
<br><font size=2 face="sans-serif"> " 88.0447770149226727
-40.3320733430391556,"</font>
<br><font size=2 face="sans-serif"> " 88.0541300495810049
-40.3914336120775417)),"</font>
<br><font size=2 face="sans-serif"> " ((87.9569549228361041
-40.1614847724049824,"</font>
<br><font size=2 face="sans-serif"> " 87.9856522556763849
-40.3125682141688557,"</font>
<br><font size=2 face="sans-serif"> " 87.9594803530699494
-40.3144955269957563,"</font>
<br><font size=2 face="sans-serif"> " 87.9484023890450430
-40.2597855714132962,"</font>
<br><font size=2 face="sans-serif"> " 87.9236385364479673
-40.1638760511710515,"</font>
<br><font size=2 face="sans-serif"> " 87.9569549228361041
-40.1614847724049824)))";</font>
<br>
<br><font size=2 face="sans-serif"> std::string mp2s = "MULTIPOLYGON
(((87.7184147523609425 -40.3314878875577705,"</font>
<br><font size=2 face="sans-serif"> " 87.7106409229361930
-40.2916861830969211,"</font>
<br><font size=2 face="sans-serif"> " 87.6363928113999862
-39.9074815079801084,"</font>
<br><font size=2 face="sans-serif"> " 87.8588765594887349
-39.8933226300382628,"</font>
<br><font size=2 face="sans-serif"> " 88.3245648150878964
-39.8616404104367064,"</font>
<br><font size=2 face="sans-serif"> " 88.3252910982550503
-39.8653834273614933,"</font>
<br><font size=2 face="sans-serif"> " 88.4058355104796334
-40.2774282017416283,"</font>
<br><font size=2 face="sans-serif"> " 88.4066631207306273
-40.2815647501607259,"</font>
<br><font size=2 face="sans-serif"> " 87.9574816223991007
-40.3146427145853394,"</font>
<br><font size=2 face="sans-serif"> " 87.7184147523609425
-40.3314878875577705)))";</font>
<br>
<br><font size=2 face="sans-serif"> try {</font>
<br><font size=2 face="sans-serif"> geos::geom::PrecisionModel
*model = </font>
<br><font size=2 face="sans-serif"> new geos::geom::PrecisionModel(geos::geom::PrecisionModel::FLOATING);</font>
<br><font size=2 face="sans-serif"> geos::geom::GeometryFactory
*factory = new geos::geom::GeometryFactory(model);</font>
<br>
<br><font size=2 face="sans-serif"> geos::io::WKTReader *wkt
= new geos::io::WKTReader();</font>
<br><font size=2 face="sans-serif"> geos::geom::MultiPolygon
*mp1 = (geos::geom::MultiPolygon *)wkt->read(mp1s);</font>
<br><font size=2 face="sans-serif"> geos::geom::MultiPolygon
*mp2 = (geos::geom::MultiPolygon *)wkt->read(mp2s);</font>
<br>
<br><font size=2 face="sans-serif"> std::cout << "Is
valid of one = " << mp1->isValid() << std::endl;</font>
<br><font size=2 face="sans-serif"> std::cout << "Is
valid of two = " << mp2->isValid() << std::endl;</font>
<br>
<br><font size=2 face="sans-serif"> geos::geom::Geometry *diff
= mp1->difference(mp2); </font>
<br>
<br><font size=2 face="sans-serif"> std::cout << mp1->toString()
<< std::endl;</font>
<br><font size=2 face="sans-serif"> std::cout << mp2->toString()
<< std::endl;</font>
<br><font size=2 face="sans-serif"> std::cout << diff->toString()
<< std::endl;</font>
<br>
<br><font size=2 face="sans-serif"> }</font>
<br><font size=2 face="sans-serif"> catch (std::exception const &se)
{</font>
<br><font size=2 face="sans-serif"> std::cout << "ERROR
- " << se.what() << std::endl;</font>
<br><font size=2 face="sans-serif"> }</font>
<br><font size=2 face="sans-serif"> catch (...) {</font>
<br><font size=2 face="sans-serif"> std::cout << "General
error" << std::endl;</font>
<br><font size=2 face="sans-serif"> }</font>
<br>
<br><font size=2 face="sans-serif">}</font>