[geos-commits] r3420 - in branches/3.3: . src/operation/valid
tests/xmltester/tests/general
svn_geos at osgeo.org
svn_geos at osgeo.org
Tue Jul 5 06:31:29 EDT 2011
Author: strk
Date: 2011-07-05 03:31:29 -0700 (Tue, 05 Jul 2011)
New Revision: 3420
Modified:
branches/3.3/NEWS
branches/3.3/src/operation/valid/IndexedNestedRingTester.cpp
branches/3.3/tests/xmltester/tests/general/TestValid.xml
Log:
Fixed NestedRingTester (used by IsValidOp) to correctly handle the case where a hole touches all the vertices of another hole (#449)
Modified: branches/3.3/NEWS
===================================================================
--- branches/3.3/NEWS 2011-07-05 10:13:49 UTC (rev 3419)
+++ branches/3.3/NEWS 2011-07-05 10:31:29 UTC (rev 3420)
@@ -2,6 +2,7 @@
????-??-??
- Bug fixes / improvements
+ - ValidOp abort in presence of 2 touching holes forming an island (#449)
- Enable prepared intersects operation for points
- Fortify suspicious code found by static analisys tools
Modified: branches/3.3/src/operation/valid/IndexedNestedRingTester.cpp
===================================================================
--- branches/3.3/src/operation/valid/IndexedNestedRingTester.cpp 2011-07-05 10:13:49 UTC (rev 3419)
+++ branches/3.3/src/operation/valid/IndexedNestedRingTester.cpp 2011-07-05 10:31:29 UTC (rev 3420)
@@ -66,6 +66,18 @@
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
assert(innerRingPt!=NULL);
Modified: branches/3.3/tests/xmltester/tests/general/TestValid.xml
===================================================================
--- branches/3.3/tests/xmltester/tests/general/TestValid.xml 2011-07-05 10:13:49 UTC (rev 3419)
+++ branches/3.3/tests/xmltester/tests/general/TestValid.xml 2011-07-05 10:31:29 UTC (rev 3420)
@@ -540,6 +540,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