[geos-commits] [SCM] GEOS branch main updated. 8c550f74b86a400b6e9c7685a6d4339eab979294

git at osgeo.org git at osgeo.org
Tue Aug 20 07:57:46 PDT 2024


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, main has been updated
       via  8c550f74b86a400b6e9c7685a6d4339eab979294 (commit)
      from  d9422f5ef776c87c78dabd705e486ee08ca39be7 (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 8c550f74b86a400b6e9c7685a6d4339eab979294
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Tue Aug 20 07:57:08 2024 -0700

    Add support for bnRule testing relates

diff --git a/tests/unit/operation/relateng/RelateNGTest.cpp b/tests/unit/operation/relateng/RelateNGTest.cpp
index 7e54c71c9..98ed898bd 100644
--- a/tests/unit/operation/relateng/RelateNGTest.cpp
+++ b/tests/unit/operation/relateng/RelateNGTest.cpp
@@ -875,5 +875,16 @@ void object::test<62> ()
     checkRelate(a, b, "212101212");
 }
 
+// Boundary node
+// template<>
+// template<>
+// void object::test<63> ()
+// {
+//     std::string a = "POLYGON((0 0,140 0,140 140,0 140,0 0))";
+//     std::string b = "POLYGON((140 0,0 0,0 140,140 140,140 0))";
+//     checkRelateRule(a, b, "2FFF0FFF2", geos::algorithm::BoundaryNodeRule::getBoundaryMultivalentEndPoint());
+// }
+
+
 
 } // namespace tut
diff --git a/tests/unit/operation/relateng/RelateNGTest.h b/tests/unit/operation/relateng/RelateNGTest.h
index 70526d6de..8231f886b 100644
--- a/tests/unit/operation/relateng/RelateNGTest.h
+++ b/tests/unit/operation/relateng/RelateNGTest.h
@@ -1,5 +1,6 @@
 
 // geos
+#include <geos/algorithm/BoundaryNodeRule.h>
 #include <geos/io/WKTReader.h>
 #include <geos/io/WKTWriter.h>
 #include <geos/geom/Geometry.h>
@@ -94,13 +95,13 @@ struct test_relateng_support {
         checkPredicate(*RelatePredicate::equalsTopo(), wktb, wkta, expectedValue);
     }
 
-    void checkRelate(const std::string& wkta, const std::string& wktb, const std::string expectedValue)
+    void checkRelateRule(const std::string& wkta, const std::string& wktb, const std::string expectedValue, const BoundaryNodeRule& bnRule)
     {
         std::unique_ptr<Geometry> a = r.read(wkta);
         std::unique_ptr<Geometry> b = r.read(wktb);
         RelateMatrixPredicate pred;
         // TopologyPredicate predTrace = trace(pred);
-        RelateNG::relate(a.get(), b.get(), pred);
+        RelateNG::relate(a.get(), b.get(), pred, bnRule);
         std::string actualVal = pred.getIM()->toString();
         if (actualVal != expectedValue) {
             std::cerr << std::endl << w.write(*a) << " relate " << w.write(*b) << " = " << actualVal << std::endl;
@@ -109,6 +110,11 @@ struct test_relateng_support {
         checkPrepared(a.get(), b.get());
     }
 
+    void checkRelate(const std::string& wkta, const std::string& wktb, const std::string expectedValue)
+    {
+        checkRelateRule(wkta, wktb, expectedValue, BoundaryNodeRule::getBoundaryRuleMod2());
+    }
+
     void checkRelateMatches(const std::string& wkta, const std::string& wktb, const std::string pattern, bool expectedValue)
     {
         auto pred = RelatePredicate::matches(pattern);

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

Summary of changes:
 tests/unit/operation/relateng/RelateNGTest.cpp | 11 +++++++++++
 tests/unit/operation/relateng/RelateNGTest.h   | 10 ++++++++--
 2 files changed, 19 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list