[geos-commits] r3421 - in branches/3.2: source/operation/valid tests/xmltester tests/xmltester/tests tests/xmltester/tests/general

svn_geos at osgeo.org svn_geos at osgeo.org
Tue Jul 5 06:53:48 EDT 2011


Author: strk
Date: 2011-07-05 03:53:48 -0700 (Tue, 05 Jul 2011)
New Revision: 3421

Removed:
   branches/3.2/tests/xmltester/tests/bug449.xml
Modified:
   branches/3.2/source/operation/valid/IndexedNestedRingTester.cpp
   branches/3.2/tests/xmltester/Makefile.am
   branches/3.2/tests/xmltester/tests/general/TestValid.xml
Log:
Re-fix #449 (#451) the JTS way


Modified: branches/3.2/source/operation/valid/IndexedNestedRingTester.cpp
===================================================================
--- branches/3.2/source/operation/valid/IndexedNestedRingTester.cpp	2011-07-05 10:31:29 UTC (rev 3420)
+++ branches/3.2/source/operation/valid/IndexedNestedRingTester.cpp	2011-07-05 10:53:48 UTC (rev 3421)
@@ -66,10 +66,21 @@
 							 searchRing,
 							 graph);
 
+        /**
+         * If no non-node pts can be found, this means
+         * that the searchRing touches ALL of the innerRing vertices.
+         * This indicates an invalid polygon, since either
+         * the two holes create a disconnected interior,
+         * or they touch in an infinite number of points
+         * (i.e. along a line segment).
+         * Both of these cases are caught by other tests,
+         * so it is safe to simply skip this situation here.
+         */
+        if ( ! innerRingPt ) continue;
+
                         // Unable to find a ring point not a node of
-			// the search ring.
-			// See http://trac.osgeo.org/geos/ticket/449
-			if ( ! innerRingPt ) continue;
+			// the search ring
+			assert(innerRingPt!=NULL);
 
 			bool isInside = algorithm::CGAlgorithms::isPointInRing(	
 					*innerRingPt, searchRingPts);

Modified: branches/3.2/tests/xmltester/Makefile.am
===================================================================
--- branches/3.2/tests/xmltester/Makefile.am	2011-07-05 10:31:29 UTC (rev 3420)
+++ branches/3.2/tests/xmltester/Makefile.am	2011-07-05 10:53:48 UTC (rev 3421)
@@ -22,7 +22,6 @@
 	$(srcdir)/tests/bug188.xml \
 	$(srcdir)/tests/bug244.xml \
 	$(srcdir)/tests/bug275.xml \
-	$(srcdir)/tests/bug449.xml \
 	$(srcdir)/tests/general/TestBoundary.xml \
 	$(srcdir)/tests/general/TestBuffer.xml \
 	$(srcdir)/tests/general/TestBufferMitredJoin.xml \

Deleted: branches/3.2/tests/xmltester/tests/bug449.xml
===================================================================
--- branches/3.2/tests/xmltester/tests/bug449.xml	2011-07-05 10:31:29 UTC (rev 3420)
+++ branches/3.2/tests/xmltester/tests/bug449.xml	2011-07-05 10:53:48 UTC (rev 3421)
@@ -1,21 +0,0 @@
-<run>
-  <precisionModel type="FLOATING" />
-
-<case>
-  <desc>
-http://trac.osgeo.org/geos/ticket/449
-  </desc>
-  <a>
- POLYGON(
- (0 0, 0 5, 6 5, 6 0, 0 0),
- (2 1, 4 1, 3 2, 2 1),
- (2 1, 1 4, 5 4, 4 1, 4 3, 3 2, 2 3, 2 1)
- )
-  </a>
-<test>
- <op name="isValid" arg1="A">false</op>
-</test>
-</case>
-
-
-</run>

Modified: branches/3.2/tests/xmltester/tests/general/TestValid.xml
===================================================================
--- branches/3.2/tests/xmltester/tests/general/TestValid.xml	2011-07-05 10:31:29 UTC (rev 3420)
+++ branches/3.2/tests/xmltester/tests/general/TestValid.xml	2011-07-05 10:53:48 UTC (rev 3421)
@@ -494,6 +494,28 @@
    </case>
 
    <case>
+      <desc>A - one holes touches another at all vertices </desc>
+      <a>
+POLYGON( (0 0, 0 5, 6 5, 6 0, 0 0), (2 1, 4 1, 3 2, 2 1), (2 1, 1 4, 5 4, 4 1, 4 3, 3 2, 2 3, 2 1) )
+</a>
+      <test>
+         <op name="isValid" arg1="A">      false      </op>
+      </test>
+   </case>
+
+   <case>
+      <desc>A - one holes touches another at several vertices </desc>
+      <a>
+POLYGON ((0 0, 0 5, 6 5, 6 0, 0 0), 
+  (2.5 1, 3.5 1, 3.5 2, 2.5 2, 2.5 1), 
+  (2.5 1.5, 1 4, 5 4, 3.5 1.5, 4 3, 3 2, 2 3, 2.5 1.5))
+  </a>
+      <test>
+         <op name="isValid" arg1="A">      false      </op>
+      </test>
+   </case>
+
+   <case>
       <desc>A - hole disconnects interiors </desc>
       <a>
 POLYGON ((0 0, 10 10, 10 0, 0 0), 



More information about the geos-commits mailing list