[geos-commits] [SCM] geos branch svn-3.6 updated. 397572542e1627df61d51cf1474da09536c93544

git at osgeo.org git at osgeo.org
Fri Jul 14 12:21:48 PDT 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "geos".

The branch, svn-3.6 has been updated
       via  397572542e1627df61d51cf1474da09536c93544 (commit)
      from  8e6d642e1928ed9e22558e45a6917ae55ccd62bb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 397572542e1627df61d51cf1474da09536c93544
Author: Sandro Santilli <strk at kbt.io>
Date:   Fri Jul 14 15:30:57 2017 +0200

    Use overlay specific result checker
    
    The check just supports some snap-distance based tolerance
    for exact match (in addition to topology equality which is
    needed for some JTS tests to pass)
    
    Closes #837 (backport of tolerant test checker to 3.6 branch)

diff --git a/tests/xmltester/XMLTester.cpp b/tests/xmltester/XMLTester.cpp
index 5673b8e..bdad20b 100644
--- a/tests/xmltester/XMLTester.cpp
+++ b/tests/xmltester/XMLTester.cpp
@@ -34,6 +34,7 @@
 #include <geos/geom/PrecisionModel.h>
 #include <geos/geom/BinaryOp.h>
 #include <geos/operation/overlay/OverlayOp.h>
+#include <geos/operation/overlay/snap/GeometrySnapper.h>
 #include <geos/operation/buffer/BufferBuilder.h>
 #include <geos/operation/buffer/BufferParameters.h>
 #include <geos/operation/buffer/BufferOp.h>
@@ -202,6 +203,16 @@ normalize_filename(const std::string& str)
     return newstring;
 }
 
+static int
+checkOverlaySuccess(geom::Geometry const& gRes, geom::Geometry const& gRealRes)
+{
+    double tol = operation::overlay::snap::GeometrySnapper::computeSizeBasedSnapTolerance(gRes);
+    if ( gRes.equals(&gRealRes) ) return 1;
+    std::cerr << "Using an overlay tolerance of " << tol << std::endl;
+    if ( gRes.equalsExact(&gRealRes, tol) ) return 1;
+    return 0;
+}
+
 /* Could be an XMLTester class private but oh well.. */
 static int
 checkBufferSuccess(geom::Geometry const& gRes, geom::Geometry const& gRealRes, double dist)
@@ -862,7 +873,7 @@ XMLTester::parseTest(const TiXmlNode* node)
                 gRealRes = gA->Union();
             }
 
-            if (gRes->equals(gRealRes.get())) success=1;
+            success = checkOverlaySuccess(*gRes, *gRealRes);
 
             actual_result=printGeom(gRealRes.get());
             expected_result=printGeom(gRes.get());

-----------------------------------------------------------------------

Summary of changes:
 tests/xmltester/XMLTester.cpp |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
geos


More information about the geos-commits mailing list