[geos-commits] r2932 - in trunk: . include/geos/operation/valid src/operation/valid tests/xmltester/tests/general

svn_geos at osgeo.org svn_geos at osgeo.org
Tue Mar 2 16:04:03 EST 2010


Author: strk
Date: 2010-03-02 16:04:02 -0500 (Tue, 02 Mar 2010)
New Revision: 2932

Modified:
   trunk/NEWS
   trunk/include/geos/operation/valid/IsValidOp.h
   trunk/src/operation/valid/IsValidOp.cpp
   trunk/tests/xmltester/tests/general/TestValid.xml
Log:
Fix false positive return from IsValidOp (#333)


Modified: trunk/NEWS
===================================================================
--- trunk/NEWS	2010-02-28 19:01:20 UTC (rev 2931)
+++ trunk/NEWS	2010-03-02 21:04:02 UTC (rev 2932)
@@ -14,6 +14,8 @@
   - Polygonizer::getDangles returns by const ref
   - Polygonizer::getInvalidRingLines returns by const ref and retains
     ownership of vector elements
+- Bug fixes:
+  - Invalid compound geometries reported as valid (#333)
 
 Changes in 3.2.0 
 

Modified: trunk/include/geos/operation/valid/IsValidOp.h
===================================================================
--- trunk/include/geos/operation/valid/IsValidOp.h	2010-02-28 19:01:20 UTC (rev 2931)
+++ trunk/include/geos/operation/valid/IsValidOp.h	2010-03-02 21:04:02 UTC (rev 2932)
@@ -4,6 +4,7 @@
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
  *
+ * Copyright (C) 2010 Sandro Santilli <strk at keybit.net>
  * Copyright (C) 2005-2006 Refractions Research Inc.
  * Copyright (C) 2001-2002 Vivid Solutions Inc.
  *

Modified: trunk/src/operation/valid/IsValidOp.cpp
===================================================================
--- trunk/src/operation/valid/IsValidOp.cpp	2010-02-28 19:01:20 UTC (rev 2931)
+++ trunk/src/operation/valid/IsValidOp.cpp	2010-03-02 21:04:02 UTC (rev 2932)
@@ -4,6 +4,7 @@
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
  *
+ * Copyright (C) 2010 Sandro Santilli <strk at keybit.net>
  * Copyright (C) 2001-2002 Vivid Solutions Inc.
  * Copyright (C) 2005 Refractions Research Inc.
  *
@@ -116,7 +117,7 @@
 {
 	if (isChecked) return;
 
-        assert( validErr == NULL );
+        //assert( validErr == NULL );
 	validErr=NULL;
 
 	// empty geometries are always valid!
@@ -132,7 +133,7 @@
 	else if (0 != (gc=dynamic_cast<const GeometryCollection *>(g)))
 		checkValid(gc);
 	else throw util::UnsupportedOperationException();
-        isChecked=true;
+        //isChecked=true;
 }
 
 /*

Modified: trunk/tests/xmltester/tests/general/TestValid.xml
===================================================================
--- trunk/tests/xmltester/tests/general/TestValid.xml	2010-02-28 19:01:20 UTC (rev 2931)
+++ trunk/tests/xmltester/tests/general/TestValid.xml	2010-03-02 21:04:02 UTC (rev 2932)
@@ -78,6 +78,14 @@
    </case>
 
    <case>
+      <desc>L - linestring with two identical points </desc>
+      <a>MULTILINESTRING((1 1, 0 0), (0 0, 0 0))</a>
+      <test>
+         <op name="isValid" arg1="A">      false      </op>
+      </test>
+   </case>
+
+   <case>
       <desc>A - zero-area polygon </desc>
       <a>POLYGON ((0 0, 0 0, 0 0, 0 0, 0 0))</a>
       <test>



More information about the geos-commits mailing list