[geos-commits] [SCM] geos branch master updated. f73910622e826b12e24fb31c7378ef8a08c07268

git at osgeo.org git at osgeo.org
Fri Jul 14 07:06:46 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, master has been updated
       via  f73910622e826b12e24fb31c7378ef8a08c07268 (commit)
      from  03073476f4a07f0fe99e804a50fcdf87e550459a (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 f73910622e826b12e24fb31c7378ef8a08c07268
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)

diff --git a/tests/xmltester/XMLTester.cpp b/tests/xmltester/XMLTester.cpp
index a5338dd..bb30b7c 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