[geos-commits] [SCM] GEOS branch main updated. d6809e45fdb9d6705ab9e55dcda3fdee07f6eddd

git at osgeo.org git at osgeo.org
Tue Jul 7 08:36:46 PDT 2026


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  d6809e45fdb9d6705ab9e55dcda3fdee07f6eddd (commit)
      from  40b2404209e65edd044386b11c4989d8226aeecb (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 d6809e45fdb9d6705ab9e55dcda3fdee07f6eddd
Author: Daniel Baston <dbaston at gmail.com>
Date:   Tue Jul 7 11:36:27 2026 -0400

    OverlayNG: Merge linear outputs (#1459)
    
    * OverlayNG: Merge linear outputs
    
    * OverlayNG: Update XML tests for merged output
    
    * split.xml: split with GeometrySplitter instead of Overlay
    
    * Update NEWS

diff --git a/NEWS.md b/NEWS.md
index 2113bbb67..9f0ae69ad 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -22,6 +22,8 @@
 - Breaking Changes:
   - BufferOp returns POLYGON EMPTY when fed Inf/Nan coords (GH-1332)
   - Return Inf when calculating distance to an empty geometry (GH-1345, Even Rouault)
+  - Overlay operations now produce a LineString geometry in cases that would previously
+    produce a MultiLineString with contiguous sub-geometries. (GH-1459, Dan Baston)
 
 
 - Fixes/Improvements:
diff --git a/src/operation/overlayng/LineBuilder.cpp b/src/operation/overlayng/LineBuilder.cpp
index 4d1a25877..27c8bf1a1 100644
--- a/src/operation/overlayng/LineBuilder.cpp
+++ b/src/operation/overlayng/LineBuilder.cpp
@@ -35,7 +35,7 @@ std::vector<std::unique_ptr<Curve>>
 LineBuilder::getLines()
 {
     markResultLines();
-    addResultLines();
+    addResultLinesMerged();
 
     // Transfer ownership of all the lines to the
     // caller
@@ -252,10 +252,10 @@ LineBuilder::buildLine(OverlayEdge* node) const
     const bool constructZ = node->getCoordinatesRO()->hasZ();
     const bool constructM = node->getCoordinatesRO()->hasM();
     geom::util::CurveBuilder cb(*geometryFactory, constructZ, constructM);
+    cb.setOutputLinearRing(false);
 
     // assert: edgeStart degree = 1
     // assert: edgeStart direction = forward
-    cb.add(*node->getCoordinatesRO(), node->isCurved());
 
     bool isNodeForward = node->isForward();
 
diff --git a/tests/unit/capi/GEOSDifferenceTest.cpp b/tests/unit/capi/GEOSDifferenceTest.cpp
index d38f28c1d..c5f70196b 100644
--- a/tests/unit/capi/GEOSDifferenceTest.cpp
+++ b/tests/unit/capi/GEOSDifferenceTest.cpp
@@ -73,7 +73,7 @@ void object::test<3>()
     result_ = GEOSDifference(geom1_, geom2_);
     ensure(result_);
 
-    expected_ = fromWKT("MULTICURVE (CIRCULARSTRING (1.7071067812 0.7071067812, 1.9238795325 0.3826834324, 2 0), CIRCULARSTRING (0 0, 0.6173165676 0.9238795325, 1.7071067812 0.7071067812))");
+    expected_ = fromWKT("CIRCULARSTRING (0 0, 0.6173165676 0.9238795325, 1.7071067812 0.7071067812, 1.9238795325 0.3826834324, 2 0)");
 
     ensure_geometry_equals(result_, expected_, 1e-8);
 }
diff --git a/tests/unit/operation/geounion/UnaryUnionOpTest.cpp b/tests/unit/operation/geounion/UnaryUnionOpTest.cpp
index 780907382..9f2023e39 100644
--- a/tests/unit/operation/geounion/UnaryUnionOpTest.cpp
+++ b/tests/unit/operation/geounion/UnaryUnionOpTest.cpp
@@ -78,6 +78,7 @@ struct test_unaryuniontest_data {
         GeomPtr b2 = normalize(b);
         bool eq = a2->equalsExact(b2.get());
         if(! eq) {
+            cout << "EXPECTED: " << wktwriter.write(a2.get()) << endl;
             cout << "OBTAINED: " << wktwriter.write(b2.get()) << endl;
         }
         return eq;
@@ -184,6 +185,8 @@ template<>
 void object::test<6>
 ()
 {
+    set_test_name("non-simple LineString");
+
     static char const* const geoms[] = {
         "LINESTRING (0 0, 10 0, 5 -5, 5 5)",
         nullptr
diff --git a/tests/unit/operation/overlayng/CoverageUnionNGTest.cpp b/tests/unit/operation/overlayng/CoverageUnionNGTest.cpp
index 01095d0f5..49db51c2f 100644
--- a/tests/unit/operation/overlayng/CoverageUnionNGTest.cpp
+++ b/tests/unit/operation/overlayng/CoverageUnionNGTest.cpp
@@ -157,7 +157,7 @@ void object::test<9> ()
 {
     checkUnion(
         "MULTILINESTRING ((1 1, 5 1), (9 1, 5 1))",
-        "MULTILINESTRING ((1 1, 5 1), (5 1, 9 1))");
+        "LINESTRING (1 1, 5 1, 9 1)");
 }
 
 /**
@@ -169,7 +169,7 @@ void object::test<10> ()
 {
     checkUnion(
         "MULTILINESTRING ((1 1, 2 1, 3 1), (4 1, 3 1, 2 1))",
-        "MULTILINESTRING ((1 1, 2 1), (2 1, 3 1), (3 1, 4 1))");
+        "LINESTRING (1 1, 2 1, 3 1, 4 1)");
 }
 
 /**
@@ -181,27 +181,29 @@ void object::test<11> ()
 {
     checkUnion(
         "MULTILINESTRING ((1 9, 3.1 8, 5 7, 7 8, 9 9), (5 7, 5 3, 4 3, 2 3), (9 5, 7 4, 5 3, 8 1))",
-        "MULTILINESTRING ((1 9, 3.1 8), (2 3, 4 3), (3.1 8, 5 7), (4 3, 5 3), (5 3, 5 7), (5 3, 7 4), (5 3, 8 1), (5 7, 7 8), (7 4, 9 5), (7 8, 9 9))");
+        "MULTILINESTRING ((1 9, 3.1 8, 5 7), (2 3, 4 3, 5 3), (5 3, 5 7), (5 3, 7 4, 9 5), (5 3, 8 1), (5 7, 7 8, 9 9))");
 }
 
-// Z values preserved in linear inpuuts
+// Z values preserved in linear inputs
 template<>
 template<>
 void object::test<12> ()
 {
+    // TODO: Should Z values be averaged?
     checkUnion(
         "MULTILINESTRING Z ((1 1 8, 5 1 9), (9 1 6, 5 1 2))",
-        "MULTILINESTRING Z ((1 1 8, 5 1 9), (5 1 2, 9 1 6))");
+        "LINESTRING Z (1 1 8, 5 1 9, 9 1 6)");
 }
 
-// M values preserved in linear inpuuts
+// M values preserved in linear inputs
 template<>
 template<>
 void object::test<13> ()
 {
+    // TODO: Should M values be averaged?
     checkUnion(
         "MULTILINESTRING M ((1 1 8, 5 1 9), (9 1 6, 5 1 2))",
-        "MULTILINESTRING M ((1 1 8, 5 1 9), (5 1 2, 9 1 6))");
+        "LINESTRING M (1 1 8, 5 1 9, 9 1 6)");
 }
 
 // Mixed Z/M values handled in linear inputs
@@ -210,8 +212,9 @@ template<>
 template<>
 void object::test<14>()
 {
+    // TODO: Should M values be coalesced?
     checkUnion("GEOMETRYCOLLECTION (LINESTRING Z(1 1 8, 5 1 9), LINESTRING M(9 1 6, 5 1 2))",
-               "MULTILINESTRING ZM ((1 1 8 NaN, 5 1 9 NaN), (5 1 9 2, 9 1 8.5 6))");
+               "LINESTRING ZM (1 1 8 NaN, 5 1 9 NaN, 9 1 8.5 6)");
 }
 
 // Z values preserved in polygonal inputs
diff --git a/tests/unit/operation/overlayng/OverlayNGGeometryCollectionTest.cpp b/tests/unit/operation/overlayng/OverlayNGGeometryCollectionTest.cpp
index 3edf40cce..9eb04234d 100644
--- a/tests/unit/operation/overlayng/OverlayNGGeometryCollectionTest.cpp
+++ b/tests/unit/operation/overlayng/OverlayNGGeometryCollectionTest.cpp
@@ -131,10 +131,12 @@ template<>
 template<>
 void object::test<6> ()
 {
+    set_test_name("testSimpleL_AA");
+
     std::string a = "LINESTRING (0 0, 10 10)";
     std::string b = "GEOMETRYCOLLECTION ( POLYGON ((1 1, 1 5, 5 5, 5 1, 1 1)), POLYGON ((9 9, 9 5, 5 5, 5 9, 9 9)) )";
     testIntersection(a, b,
-        "MULTILINESTRING ((1 1, 5 5), (5 5, 9 9))");
+        "LINESTRING (1 1, 5 5, 9 9)");
     testUnion(a, b,
         "GEOMETRYCOLLECTION (LINESTRING (0 0, 1 1), LINESTRING (9 9, 10 10), POLYGON ((1 1, 1 5, 5 5, 5 1, 1 1)), POLYGON ((5 5, 5 9, 9 9, 9 5, 5 5)))");
     }
diff --git a/tests/unit/operation/overlayng/OverlayNGTest.cpp b/tests/unit/operation/overlayng/OverlayNGTest.cpp
index 2da3cbcca..0240fa457 100644
--- a/tests/unit/operation/overlayng/OverlayNGTest.cpp
+++ b/tests/unit/operation/overlayng/OverlayNGTest.cpp
@@ -234,10 +234,12 @@ template<>
 template<>
 void object::test<13> ()
 {
+    set_test_name("testAreaLineIntersection");
+
     std::string a = "POLYGON ((360 200, 220 200, 220 180, 300 180, 300 160, 300 140, 360 200))";
     std::string b = "MULTIPOLYGON (((280 180, 280 160, 300 160, 300 180, 280 180)), ((220 230, 240 230, 240 180, 220 180, 220 230)))";
     // std::string exp = "POLYGON ((220 200, 240 200, 240 180, 220 180, 220 200))";
-    std::string exp = "GEOMETRYCOLLECTION (LINESTRING (280 180, 300 180), LINESTRING (300 160, 300 180), POLYGON ((220 180, 220 200, 240 200, 240 180, 220 180)))";
+    std::string exp = "GEOMETRYCOLLECTION (LINESTRING (280 180, 300 180, 300 160), POLYGON ((220 180, 220 200, 240 200, 240 180, 220 180)))";
     testOverlay(a, b, exp, OverlayNG::INTERSECTION, 1);
 }
 
@@ -500,9 +502,11 @@ template<>
 template<>
 void object::test<37> ()
 {
+    set_test_name("testCollapseTriBoxUnion");
+
     std::string a = "POLYGON ((1 3.3, 1.3 1.4, 3.1 1.4, 3.1 0.9, 1.3 0.9, 1 -0.2, 0.8 1.3, 1 3.3))";
     std::string b = "POLYGON ((1 2.9, 2.9 2.9, 2.9 1.3, 1.7 1, 1.3 0.9, 1 0.4, 1 2.9))";
-    std::string exp = "MULTILINESTRING ((1 1, 1 0), (1 3, 1 1), (1 1, 2 1), (2 1, 3 1))";
+    std::string exp = "MULTILINESTRING ((1 1, 1 0), (1 3, 1 1), (1 1, 2 1, 3 1))";
     testOverlay(a, b, exp, OverlayNG::INTERSECTION, 1);
 }
 
@@ -808,9 +812,7 @@ void object::test<62>()
 
     std::string a = "CIRCULARSTRING (0 0, 1 1, 2 0, 3 -1, 4 0)";
 
-    // Noding causes the CircularString to split at (2, 0)
-    // OverlayNG does not merge output lines, so we get a MultiCurve.
-    std::string exp = "MULTICURVE (CIRCULARSTRING (0 0, 1 1, 2 0), CIRCULARSTRING (2 0, 3 -1, 4 0))";
+    std::string exp = "CIRCULARSTRING (0 0, 1 1, 2 0, 3 -1, 4 0)";
 
     testOverlay(a, a, exp, OverlayNG::UNION, 0);
 }
diff --git a/tests/unit/operation/overlayng/OverlayNGZTest.cpp b/tests/unit/operation/overlayng/OverlayNGZTest.cpp
index d8625d3cb..7eb79756c 100644
--- a/tests/unit/operation/overlayng/OverlayNGZTest.cpp
+++ b/tests/unit/operation/overlayng/OverlayNGZTest.cpp
@@ -129,11 +129,13 @@ template<>
 template<>
 void object::test<5> ()
 {
+  set_test_name("testLineOverlapUnion");
+
   checkUnion("LINESTRING (0 0 0, 10 10 10)", "LINESTRING (5 5 990, 15 15 999)",
-      "MULTILINESTRING Z((0 0 0, 5 5 990), (5 5 990, 10 10 10), (10 10 10, 15 15 999))");
+      "LINESTRING Z(0 0 0, 5 5 990, 10 10 10, 15 15 999)");
 
   checkUnion("LINESTRING M (0 0 0, 10 10 10)", "LINESTRING M (5 5 990, 15 15 999)",
-      "MULTILINESTRING M((0 0 0, 5 5 990), (5 5 990, 10 10 10), (10 10 10, 15 15 999))");
+      "LINESTRING M(0 0 0, 5 5 990, 10 10 10, 15 15 999)");
 }
 
 // testLineLineXYDifferenceLineInterpolated
diff --git a/tests/unit/operation/overlayng/PrecisionReducerTest.cpp b/tests/unit/operation/overlayng/PrecisionReducerTest.cpp
index 7d9dc6ea0..8953a9dd2 100644
--- a/tests/unit/operation/overlayng/PrecisionReducerTest.cpp
+++ b/tests/unit/operation/overlayng/PrecisionReducerTest.cpp
@@ -159,8 +159,10 @@ template<>
 template<>
 void object::test<13> ()
 {
+    set_test_name("testCollapsedNodedLine");
+
     checkReduce("LINESTRING(1 1, 3 3, 9 9, 5.1 5, 2.1 2)",
-        1, "MULTILINESTRING ((1 1, 2 2), (2 2, 3 3), (3 3, 5 5), (5 5, 9 9))");
+        1, "LINESTRING (1 1, 2 2, 3 3, 5 5, 9 9)");
 }
 
 //
diff --git a/tests/unit/operation/sharedpaths/SharedPathsOpTest.cpp b/tests/unit/operation/sharedpaths/SharedPathsOpTest.cpp
index ded1c83fc..78f6e9936 100644
--- a/tests/unit/operation/sharedpaths/SharedPathsOpTest.cpp
+++ b/tests/unit/operation/sharedpaths/SharedPathsOpTest.cpp
@@ -324,9 +324,8 @@ void object::test<16>
     forwDir.clear();
     backDir.clear();
     SharedPathsOp::sharedPathsOp(*g0, *g1, forwDir, backDir);
-    ensure_equals(forwDir.size(), 2u);
-    ensure_equals(wktwriter.write(forwDir[0]), "LINESTRING (0 0, 5 10)");
-    ensure_equals(wktwriter.write(forwDir[1]), "LINESTRING (5 10, 10 10)");
+    ensure_equals(forwDir.size(), 1u);
+    ensure_equals(wktwriter.write(forwDir[0]), "LINESTRING (0 0, 5 10, 10 10)");
     SharedPathsOp::clearEdges(forwDir);
 
     ensure(backDir.empty());
@@ -343,9 +342,8 @@ void object::test<17>
     forwDir.clear();
     backDir.clear();
     SharedPathsOp::sharedPathsOp(*g0, *g1, forwDir, backDir);
-    ensure_equals(backDir.size(), 2u);
-    ensure_equals(wktwriter.write(backDir[0]), "LINESTRING (0 0, 5 10)");
-    ensure_equals(wktwriter.write(backDir[1]), "LINESTRING (5 10, 10 10)");
+    ensure_equals(backDir.size(), 1u);
+    ensure_equals(wktwriter.write(backDir[0]), "LINESTRING (0 0, 5 10, 10 10)");
     SharedPathsOp::clearEdges(backDir);
 
     ensure(forwDir.empty());
diff --git a/tests/xmltester/XMLTester.cpp b/tests/xmltester/XMLTester.cpp
index be5445813..01803404b 100644
--- a/tests/xmltester/XMLTester.cpp
+++ b/tests/xmltester/XMLTester.cpp
@@ -43,6 +43,7 @@
 #include <geos/operation/buffer/BufferParameters.h>
 #include <geos/operation/buffer/BufferOp.h>
 #include <geos/operation/polygonize/BuildArea.h>
+#include <geos/operation/split/GeometrySplitter.h>
 #include <geos/operation/valid/MakeValid.h>
 #include <geos/precision/MinimumClearance.h>
 #include <geos/simplify/TopologyPreservingSimplifier.h>
@@ -1395,6 +1396,10 @@ void Test::executeOp(Geometry* gA, Geometry* gB)
         double tolerance = std::atof(opArg2.c_str());
         checkResult( *geos::simplify::TopologyPreservingSimplifier::simplify(gA, tolerance) );
     }
+    else if (opName == "split")
+    {
+        checkResult(*geos::operation::split::GeometrySplitter::split(*gA, *gB));
+    }
     else {
         //TODO: error out here?
         std::cerr << tester.testcaseRef() << " - " << opName;
diff --git a/tests/xmltester/tests/general/TestNGOverlayA.xml b/tests/xmltester/tests/general/TestNGOverlayA.xml
index 3d981d481..7c9089c67 100644
--- a/tests/xmltester/tests/general/TestNGOverlayA.xml
+++ b/tests/xmltester/tests/general/TestNGOverlayA.xml
@@ -259,7 +259,7 @@ Uses a floating precision model.
   </b>
 <test>
   <op name="intersectionNG" arg1="A" arg2="B">
-    MULTILINESTRING ((27 27, 27 13), (27 13, 13 13), (13 27, 27 27), (13 13, 13 27))
+    LINESTRING (13 13, 13 27, 27 27, 27 13, 13 13)
   </op>
 </test>
 <test>
@@ -482,8 +482,7 @@ POLYGON ((13 27, 27 27, 27 13, 13 13, 13 27), (15 25, 20 25, 20 20, 15 20, 15 25
   <op name="intersectionNG" arg1="A" arg2="B">
   GEOMETRYCOLLECTION (POLYGON ((22 22, 27 22, 27 20, 20 20, 20 25, 20 27, 22 27, 22 22)),
     POLYGON ((15 20, 20 20, 20 13, 15 13, 15 15, 13 15, 13 20, 15 20)),
-    LINESTRING (22 27, 27 27),
-    LINESTRING (27 27, 27 22))
+    LINESTRING (22 27, 27 27, 27 22))
   </op>
 </test>
 <test>
diff --git a/tests/xmltester/tests/general/TestNGOverlayAPrec.xml b/tests/xmltester/tests/general/TestNGOverlayAPrec.xml
index e20a8edd1..0eb8934f1 100644
--- a/tests/xmltester/tests/general/TestNGOverlayAPrec.xml
+++ b/tests/xmltester/tests/general/TestNGOverlayAPrec.xml
@@ -67,10 +67,9 @@ POLYGON ((1 3.3, 1.3 1.4, 3.1 1.4, 3.1 0.9, 1.3 0.9, 1 -0.2, 0.8 1.3, 1 3.3))
 POLYGON ((1 2.9, 2.9 2.9, 2.9 1.3, 1.7 1, 1.3 0.9, 1 0.4, 1 2.9))
   </b>
 <test>  <op name="intersectionSR" arg1="A" arg2="B" arg3="1">
-MULTILINESTRING ((1 1, 2 1), 
+MULTILINESTRING ((1 1, 2 1, 3 1), 
   (1 1, 1 0), 
-  (1 3, 1 1), 
-  (2 1, 3 1))
+  (1 3, 1 1))
   </op></test>
 <test>  <op name="unionSR" arg1="A" arg2="B" arg3="1">
 GEOMETRYCOLLECTION (POLYGON ((1 1, 1 3, 3 3, 3 1, 2 1, 1 1)), 
@@ -307,10 +306,10 @@ POLYGON ((1 1, 1 4, 3 4, 3 1.3, 7 1, 1 1))
 POLYGON ((8 4, 9 4, 9 1, 4 1, 8 1.3, 8 4))
   </b>
 <test>  <op name="intersectionSR" arg1="A" arg2="B" arg3="1">
-MULTILINESTRING ((6 1, 7 1), (4 1, 6 1))
+LINESTRING (4 1, 6 1, 7 1)
   </op></test>
 <test>  <op name="unionSR" arg1="A" arg2="B" arg3="1">
-GEOMETRYCOLLECTION (POLYGON ((9 4, 9 1, 8 1, 8 4, 9 4)), POLYGON ((1 4, 3 4, 3 1, 1 1, 1 4)), LINESTRING (8 1, 7 1), LINESTRING (6 1, 7 1), LINESTRING (3 1, 4 1), LINESTRING (4 1, 6 1))
+GEOMETRYCOLLECTION (POLYGON ((9 4, 9 1, 8 1, 8 4, 9 4)), POLYGON ((1 4, 3 4, 3 1, 1 1, 1 4)), LINESTRING (3 1, 4 1, 6 1, 7 1, 8 1))
   </op></test>
 <test>  <op name="differenceSR" arg1="A" arg2="B" arg3="1">
 GEOMETRYCOLLECTION (POLYGON ((1 4, 3 4, 3 1, 1 1, 1 4)), LINESTRING (3 1, 4 1))
@@ -323,4 +322,4 @@ GEOMETRYCOLLECTION (POLYGON ((9 4, 9 1, 8 1, 8 4, 9 4)), POLYGON ((1 4, 3 4, 3 1
   </op></test>
 </case>
 
-</run>
\ No newline at end of file
+</run>
diff --git a/tests/xmltester/tests/general/TestNGOverlayGC.xml b/tests/xmltester/tests/general/TestNGOverlayGC.xml
index d50eb44c7..1dd39b37d 100644
--- a/tests/xmltester/tests/general/TestNGOverlayGC.xml
+++ b/tests/xmltester/tests/general/TestNGOverlayGC.xml
@@ -74,7 +74,7 @@ Uses a floating precision model.
   </b>
 <test>
   <op name="intersectionNG" arg1="A" arg2="B">
-    MULTILINESTRING ((1 1, 5 5), (5 5, 9 9))
+    LINESTRING (1 1, 5 5, 9 9)
   </op>
 </test>
 <test>
diff --git a/tests/xmltester/tests/general/TestNGOverlayL.xml b/tests/xmltester/tests/general/TestNGOverlayL.xml
index 4ec2faba4..1db4001d4 100644
--- a/tests/xmltester/tests/general/TestNGOverlayL.xml
+++ b/tests/xmltester/tests/general/TestNGOverlayL.xml
@@ -44,10 +44,10 @@ POINT (15 15)
 MULTILINESTRING ((10 10, 15 15), (15 15, 20 20), (10 20, 15 15), (15 15, 20 10))
   </op></test>
 <test>  <op name="differenceNG" arg1="A" arg2="B">
-MULTILINESTRING ((10 10, 15 15), (15 15, 20 20))
+LINESTRING (10 10, 15 15, 20 20)
   </op></test>
 <test>  <op name="differenceNG" arg1="B" arg2="A">
-MULTILINESTRING ((10 20, 15 15), (15 15, 20 10))
+LINESTRING (10 20, 15 15, 20 10)
   </op></test>
 <test>  <op name="symdifferenceNG" arg1="A" arg2="B">
 MULTILINESTRING ((10 10, 15 15), (15 15, 20 20), (10 20, 15 15), (15 15, 20 10))
@@ -75,7 +75,7 @@ LINESTRING (10 10, 20 20)
 LINESTRING (20 20, 30 30)
   </op></test>
 <test>  <op name="symdifferenceNG" arg1="A" arg2="B">
-MULTILINESTRING ((20 20, 30 30), (10 10, 20 20))
+LINESTRING (10 10, 20 20, 30 30)
   </op></test>
 </case>
 
@@ -150,7 +150,7 @@ MULTILINESTRING ((0 10, 10 10, 20 20), (30 30, 40 30))
 MULTILINESTRING ((20 0, 20 20), (30 30, 30 40))
   </op></test>
 <test>  <op name="symdifferenceNG" arg1="A" arg2="B">
-MULTILINESTRING ((0 10, 10 10, 20 20), (20 0, 20 20), (30 30, 30 40), (30 30, 40 30))
+MULTILINESTRING ((0 10, 10 10, 20 20, 20 0), (40 30, 30 30, 30 40))
   </op></test>
 </case>
 
@@ -169,13 +169,13 @@ GEOMETRYCOLLECTION (LINESTRING (0 0, 3 3), POINT (5 5))
 MULTILINESTRING ((5 5, 1 9), (0 0, 3 3), (5 5, 10 10), (3 3, 8 2, 5 5), (3 3, 5 5))
   </op></test>
 <test>  <op name="differenceNG" arg1="A" arg2="B">
-MULTILINESTRING ((5 5, 10 10), (3 3, 5 5))
+LINESTRING (3 3, 5 5, 10 10)
   </op></test>
 <test>  <op name="differenceNG" arg1="B" arg2="A">
-MULTILINESTRING ((5 5, 1 9), (3 3, 8 2, 5 5))
+LINESTRING (3 3, 8 2, 5 5, 1 9)
   </op></test>
 <test>  <op name="symdifferenceNG" arg1="A" arg2="B">
-MULTILINESTRING ((5 5, 1 9), (5 5, 10 10), (3 3, 8 2, 5 5), (3 3, 5 5))
+MULTILINESTRING ((5 5, 1 9), (5 5, 10 10), (5 5, 3 3, 8 2, 5 5))
   </op></test>
 </case>
 
@@ -194,10 +194,10 @@ POINT (150 150)
 MULTILINESTRING ((150 150, 200 200, 300 300, 400 200), (100 100, 150 150), (190 110, 150 150), (150 150, 120 180))
   </op></test>
 <test>  <op name="differenceNG" arg1="A" arg2="B">
-MULTILINESTRING ((150 150, 200 200, 300 300, 400 200), (100 100, 150 150))
+LINESTRING (100 100, 150 150, 200 200, 300 300, 400 200)
   </op></test>
 <test>  <op name="differenceNG" arg1="B" arg2="A">
-MULTILINESTRING ((190 110, 150 150), (150 150, 120 180))
+LINESTRING (190 110, 150 150, 120 180)
   </op></test>
 <test>  <op name="symdifferenceNG" arg1="A" arg2="B">
 MULTILINESTRING ((150 150, 200 200, 300 300, 400 200), (100 100, 150 150), (190 110, 150 150), (150 150, 120 180))
diff --git a/tests/xmltester/tests/general/TestNGOverlayLPrec.xml b/tests/xmltester/tests/general/TestNGOverlayLPrec.xml
index 99ec16f03..70dabbf80 100644
--- a/tests/xmltester/tests/general/TestNGOverlayLPrec.xml
+++ b/tests/xmltester/tests/general/TestNGOverlayLPrec.xml
@@ -22,10 +22,10 @@ MULTIPOINT ((2 2), (3 3))
 MULTILINESTRING ((1 1, 2 2), (2 2, 3 3), (3 3, 4 4), (2 2, 4 2), (3 1, 2 2), (3 4, 3 3), (3 3, 1 3))
   </op></test>
 <test>  <op name="differenceSR" arg1="A" arg2="B" arg3="1">
-MULTILINESTRING ((1 1, 2 2), (2 2, 3 3), (3 3, 4 4))
+LINESTRING (1 1, 2 2, 3 3, 4 4)
   </op></test>
 <test>  <op name="differenceSR" arg1="B" arg2="A" arg3="1">
-MULTILINESTRING ((2 2, 4 2), (3 1, 2 2), (3 4, 3 3), (3 3, 1 3))
+MULTILINESTRING ((3 1, 2 2, 4 2), (3 4, 3 3, 1 3))
   </op></test>
 <test>  <op name="symDifferenceSR" arg1="A" arg2="B" arg3="1">
 MULTILINESTRING ((1 1, 2 2), (2 2, 3 3), (3 3, 4 4), (2 2, 4 2), (3 1, 2 2), (3 4, 3 3), (3 3, 1 3))
@@ -41,10 +41,10 @@ LINESTRING (1.1 1.3, 2.6 2.8, 3.8 3.3)
 LINESTRING (0.3 2.8, 1.4 1.9, 2.7 2.6, 2.9 3.8)
   </b>
 <test>  <op name="intersectionSR" arg1="A" arg2="B" arg3="1">
-MULTILINESTRING ((1 2, 2 2), (2 2, 3 3))
+LINESTRING (1 2, 2 2, 3 3)
   </op></test>
 <test>  <op name="unionSR" arg1="A" arg2="B" arg3="1">
-MULTILINESTRING ((1 1, 1 2), (1 2, 2 2), (2 2, 3 3), (3 3, 4 3), (0 3, 1 2), (3 3, 3 4))
+MULTILINESTRING ((1 1, 1 2), (1 2, 2 2, 3 3), (3 3, 4 3), (0 3, 1 2), (3 3, 3 4))
   </op></test>
 <test>  <op name="differenceSR" arg1="A" arg2="B" arg3="1">
 MULTILINESTRING ((1 1, 1 2), (3 3, 4 3))
@@ -53,7 +53,7 @@ MULTILINESTRING ((1 1, 1 2), (3 3, 4 3))
 MULTILINESTRING ((0 3, 1 2), (3 3, 3 4))
   </op></test>
 <test>  <op name="symDifferenceSR" arg1="A" arg2="B" arg3="1">
-MULTILINESTRING ((1 1, 1 2), (3 3, 4 3), (0 3, 1 2), (3 3, 3 4))
+MULTILINESTRING ((1 1, 1 2, 0 3), (3 4, 3 3, 4 3))
   </op></test>
 </case>
 
@@ -66,10 +66,10 @@ LINESTRING (0 0, 1.8 2.3, 1.1 1.1, 3 3)
 LINESTRING (0.7 0.7, 2.8 2.6)
   </b>
 <test>  <op name="intersectionSR" arg1="A" arg2="B" arg3="1">
-MULTILINESTRING ((1 1, 2 2), (2 2, 3 3))
+LINESTRING (1 1, 2 2, 3 3)
   </op></test>
 <test>  <op name="unionSR" arg1="A" arg2="B" arg3="1">
-MULTILINESTRING ((0 0, 1 1), (1 1, 2 2), (2 2, 3 3))
+LINESTRING (0 0, 1 1, 2 2, 3 3)
   </op></test>
 <test>  <op name="differenceSR" arg1="A" arg2="B" arg3="1">
 LINESTRING (0 0, 1 1)
@@ -91,10 +91,10 @@ LINESTRING (0 1, 0.9 1.1, 1.8 1.1, 3.2 0.9, 5 0.7, 6.1 0.7, 7.3 0.6)
 LINESTRING (0 2, 1.1 1.7, 3.7 1.2, 5.4 1.6, 6.1 2.1, 7.2 2.2)
   </b>
 <test>  <op name="intersectionSR" arg1="A" arg2="B" arg3="1">
-MULTILINESTRING ((4 1, 5 1), (2 1, 3 1), (3 1, 4 1))
+LINESTRING (2 1, 3 1, 4 1, 5 1)
   </op></test>
 <test>  <op name="unionSR" arg1="A" arg2="B" arg3="1">
-MULTILINESTRING ((5 1, 6 1, 7 1), (0 1, 1 1, 2 1), (0 2, 1 2, 2 1), (4 1, 5 1), (2 1, 3 1), (3 1, 4 1), (5 1, 5 2, 6 2, 7 2))
+MULTILINESTRING ((5 1, 6 1, 7 1), (0 1, 1 1, 2 1), (0 2, 1 2, 2 1), (2 1, 3 1, 4 1, 5 1), (5 1, 5 2, 6 2, 7 2))
   </op></test>
 <test>  <op name="differenceSR" arg1="A" arg2="B" arg3="1">
 MULTILINESTRING ((5 1, 6 1, 7 1), (0 1, 1 1, 2 1))
@@ -103,8 +103,8 @@ MULTILINESTRING ((5 1, 6 1, 7 1), (0 1, 1 1, 2 1))
 MULTILINESTRING ((0 2, 1 2, 2 1), (5 1, 5 2, 6 2, 7 2))
   </op></test>
 <test>  <op name="symDifferenceSR" arg1="A" arg2="B" arg3="1">
-MULTILINESTRING ((5 1, 6 1, 7 1), (0 1, 1 1, 2 1), (0 2, 1 2, 2 1), (5 1, 5 2, 6 2, 7 2))
+MULTILINESTRING ((7 2, 6 2, 5 2, 5 1, 6 1, 7 1), (0 1, 1 1, 2 1, 1 2, 0 2))
   </op></test>
 </case>
 
-</run>
\ No newline at end of file
+</run>
diff --git a/tests/xmltester/tests/general/TestOverlayAA.xml b/tests/xmltester/tests/general/TestOverlayAA.xml
index 2f4a5d92e..6a93130aa 100644
--- a/tests/xmltester/tests/general/TestOverlayAA.xml
+++ b/tests/xmltester/tests/general/TestOverlayAA.xml
@@ -357,9 +357,7 @@
     GEOMETRYCOLLECTION(
       POINT(200 240), 
       LINESTRING(300 200, 220 200), 
-      LINESTRING(280 180, 300 180), 
-      LINESTRING(300 180, 300 160), 
-      LINESTRING(300 160, 280 160), 
+      LINESTRING(280 180, 300 180, 300 160, 280 160), 
       LINESTRING(220 140, 240 140), 
       LINESTRING(240 120, 220 120), 
       POLYGON(
@@ -451,22 +449,10 @@
       POINT(260 160), 
       POINT(280 220), 
       POINT(300 200), 
-      LINESTRING(100 200, 100 180), 
-      LINESTRING(100 180, 120 180), 
-      LINESTRING(120 180, 120 200), 
-      LINESTRING(120 200, 100 200), 
-      LINESTRING(220 140, 220 160), 
-      LINESTRING(220 160, 160 160), 
-      LINESTRING(160 160, 160 180), 
-      LINESTRING(160 180, 200 180), 
-      LINESTRING(200 200, 160 200), 
-      LINESTRING(160 200, 160 220), 
-      LINESTRING(160 220, 220 220), 
-      LINESTRING(220 220, 220 240), 
-      LINESTRING(80 220, 80 160), 
-      LINESTRING(80 160, 140 160), 
-      LINESTRING(140 160, 140 220), 
-      LINESTRING(140 220, 80 220))
+      LINESTRING(100 200, 100 180, 120 180, 120 200, 100 200), 
+      LINESTRING(220 140, 220 160, 160 160, 160 180, 200 180), 
+      LINESTRING(200 200, 160 200, 160 220, 220 220, 220 240), 
+      LINESTRING(80 220, 80 160, 140 160, 140 220, 80 220))
   </op>
 </test>
 <test>
diff --git a/tests/xmltester/tests/general/TestOverlayAAPrec.xml b/tests/xmltester/tests/general/TestOverlayAAPrec.xml
index f3b8dc0ae..c87ce14a2 100644
--- a/tests/xmltester/tests/general/TestOverlayAAPrec.xml
+++ b/tests/xmltester/tests/general/TestOverlayAAPrec.xml
@@ -115,9 +115,7 @@
   </b>
 <test>
   <op name="intersection" arg1="A" arg2="B">
-    MULTILINESTRING(
-      (10 30, 10 10),
-      (10 10, 30 10))
+    LINESTRING (10 30, 10 10, 30 10)
   </op>
 </test>
 <test>
@@ -273,9 +271,7 @@
   </b>
 <test>
   <op name="intersection" arg1="A" arg2="B">
-    MULTILINESTRING(
-      (10 30, 10 10),
-      (10 10, 30 10))
+    LINESTRING (10 30, 10 10, 30 10)
   </op>
 </test>
 <test>
@@ -317,9 +313,7 @@
   </b>
 <test>
   <op name="intersection" arg1="A" arg2="B">
-    MULTILINESTRING(
-      (10 30, 10 10),
-      (10 10, 30 10))
+    LINESTRING(10 30, 10 10, 30 10)
   </op>
 </test>
 <test>
@@ -361,9 +355,7 @@
   </b>
 <test>
   <op name="intersection" arg1="A" arg2="B">
-    MULTILINESTRING(
-      (10 30, 10 10),
-      (10 10, 30 10))
+    LINESTRING(10 30, 10 10, 30 10)
   </op>
 </test>
 <test>
@@ -606,9 +598,7 @@ GEOMETRYCOLLECTION(
   </b>
 <test>
   <op name="intersection" arg1="A" arg2="B">
-    MULTILINESTRING(
-      (160 140, 160 120),
-      (160 120, 160 100))
+    LINESTRING(160 140, 160 120, 160 100)
   </op>
 </test>
 <test>
@@ -719,8 +709,7 @@ GEOMETRYCOLLECTION(
 <test>
   <op name="symdifference" arg1="A" arg2="B">
     GEOMETRYCOLLECTION(
-      LINESTRING(78 39, 83 39),
-      LINESTRING(83 33, 83 39),
+      LINESTRING(78 39, 83 39, 83 33),
       POLYGON(
         (83 39, 62 402, 68 402, 83 39)),
       POLYGON(
diff --git a/tests/xmltester/tests/general/TestOverlayLA.xml b/tests/xmltester/tests/general/TestOverlayLA.xml
index f9444fbf9..97cab3b82 100644
--- a/tests/xmltester/tests/general/TestOverlayLA.xml
+++ b/tests/xmltester/tests/general/TestOverlayLA.xml
@@ -20,8 +20,7 @@
   <op name="symdifference" pattern="FFFFFFFFF" arg1="A" arg2="B">
     GEOMETRYCOLLECTION(
       LINESTRING(100 240, 100 180, 160 180, 160 120, 220 120), 
-      LINESTRING(40 360, 40 60), 
-      LINESTRING(40 60, 340 60, 40 360), 
+      LINESTRING(40 60, 340 60, 40 360, 40 60), 
       LINESTRING(40 60, 40 20), 
       LINESTRING(120 120, 120 140, 100 140, 100 120, 120 120), 
       LINESTRING(120 120, 140 120), 
@@ -87,20 +86,16 @@
         (220 260, 140 260), 
         (140 260, 120 260), 
         (120 260, 60 260), 
-        (200 240, 140 240), 
+        (220 240, 200 240, 140 240), 
         (140 240, 120 240), 
-        (120 240, 80 240), 
         (180 220, 140 220), 
         (140 220, 120 220), 
         (120 220, 100 220), 
-        (120 200, 120 180), 
-        (220 240, 200 240), 
-        (80 240, 60 240), 
+        (120 220, 120 200, 120 180, 120 160), 
+        (120 240, 80 240, 60 240), 
         (60 220, 80 220), 
         (200 220, 220 220), 
         (120 260, 120 240), 
-        (120 220, 120 200), 
-        (120 180, 120 160), 
         (120 140, 120 120), 
         (140 120, 140 140), 
         (140 160, 140 180), 
@@ -160,17 +155,14 @@
         LINESTRING(80 220, 100 220), 
         LINESTRING(180 220, 200 220), 
         LINESTRING(220 220, 240 220), 
-        LINESTRING(120 300, 120 260), 
+        LINESTRING(120 320, 120 300, 120 260), 
         LINESTRING(120 240, 120 220), 
         LINESTRING(120 160, 120 140), 
-        LINESTRING(120 120, 120 80), 
-        LINESTRING(120 80, 140 80), 
-        LINESTRING(140 80, 140 120), 
+        LINESTRING(120 120, 120 80, 140 80, 140 120), 
         LINESTRING(140 140, 140 160), 
         LINESTRING(140 180, 140 200), 
         LINESTRING(140 220, 140 240), 
         LINESTRING(140 260, 140 300), 
-        LINESTRING(120 300, 120 320), 
         POLYGON(
           (60 240, 60 260, 120 260, 140 260, 220 260, 220 240, 220 220, 220 120, 140 120, 
           120 120, 60 120, 60 220, 60 240), 
@@ -205,8 +197,7 @@
     GEOMETRYCOLLECTION(
       LINESTRING(220 360, 220 320), 
       LINESTRING(220 260, 220 240, 240 240), 
-      LINESTRING(280 240, 300 240), 
-      LINESTRING(300 240, 300 360), 
+      LINESTRING(280 240, 300 240, 300 360), 
       POLYGON(
         (280 240, 280 120, 60 120, 60 320, 220 320, 280 320, 280 240), 
         (120 260, 120 180, 240 180, 240 240, 240 260, 220 260, 120 260)), 
@@ -249,10 +240,9 @@
     GEOMETRYCOLLECTION(
       POINT(300 240), 
       POINT(300 360), 
-      LINESTRING(80 300, 80 160), 
+      LINESTRING(220 300, 80 300, 80 160), 
       LINESTRING(80 160, 260 160, 260 240), 
       LINESTRING(260 240, 260 300, 220 300), 
-      LINESTRING(220 300, 80 300), 
       LINESTRING(80 160, 80 140), 
       LINESTRING(220 320, 220 300), 
       LINESTRING(220 300, 220 260), 
@@ -280,12 +270,9 @@
 <test>
   <op name="symdifference" pattern="FFFFFFFFF" arg1="A" arg2="B">
     GEOMETRYCOLLECTION(
-      LINESTRING(180 260, 120 180), 
-      LINESTRING(120 180, 60 260), 
-      LINESTRING(60 260, 180 260), 
+      LINESTRING(120 180, 60 260, 180 260, 120 180), 
       LINESTRING(60 300, 60 260), 
-      LINESTRING(60 260, 60 80), 
-      LINESTRING(60 80, 60 40), 
+      LINESTRING(60 260, 60 80, 60 40), 
       POLYGON(
         (60 80, 120 180, 180 80, 60 80)), 
       POLYGON(
diff --git a/tests/xmltester/tests/general/TestOverlayLL.xml b/tests/xmltester/tests/general/TestOverlayLL.xml
index 89c481eb5..3d723abb0 100644
--- a/tests/xmltester/tests/general/TestOverlayLL.xml
+++ b/tests/xmltester/tests/general/TestOverlayLL.xml
@@ -24,9 +24,7 @@
 </test>
 <test>
   <op name="difference" arg1="A" arg2="B">
-    MULTILINESTRING(
-      (0 0, 50 50), 
-      (50 50, 100 100))
+    LINESTRING(0 0, 50 50, 100 100) 
   </op>
 </test>
 <test>
@@ -68,9 +66,7 @@
 </test>
 <test>
   <op name="symdifference" arg1="A" arg2="B">
-    MULTILINESTRING(
-      (100 100, 200 200), 
-      (100 100, 200 0))
+    LINESTRING(200 0, 100 100, 200 200)
   </op>
 </test>
 </case>
@@ -119,10 +115,7 @@
   </b>
 <test>
   <op name="intersection" arg1="A" arg2="B">
-    MULTILINESTRING(
-      (220 160, 80 300), 
-      (80 320, 220 320), 
-      (220 320, 220 160))
+    LINESTRING(80 320, 220 320, 220 160, 80 300) 
   </op>
 </test>
 <test>
@@ -172,9 +165,7 @@
 </test>
 <test>
   <op name="symdifference" arg1="A" arg2="B">
-    MULTILINESTRING(
-      (60 200, 60 260, 140 200), 
-      (60 200, 60 140, 140 200))
+    LINESTRING(60 200, 60 260, 140 200, 60 140, 60 200) 
   </op>
 </test>
 </case>
@@ -204,19 +195,16 @@
 </test>
 <test>
   <op name="difference" arg1="A" arg2="B">
-    MULTILINESTRING(
-      (100 120, 180 200), 
-      (180 200, 100 280, 20 200, 100 120))
+    LINESTRING(180 200, 100 280, 20 200, 100 120, 180 200)
   </op>
 </test>
 <test>
   <op name="symdifference" arg1="A" arg2="B">
     MULTILINESTRING(
       (100 120, 180 200), 
-      (100 120, 100 200), 
+      (100 120, 100 200, 180 200), 
       (180 200, 100 280, 20 200, 100 120), 
-      (180 200, 220 200, 220 80, 100 80, 100 120), 
-      (100 200, 180 200))
+      (180 200, 220 200, 220 80, 100 80, 100 120))
   </op>
 </test>
 </case>
diff --git a/tests/xmltester/tests/general/TestOverlayLLPrec.xml b/tests/xmltester/tests/general/TestOverlayLLPrec.xml
index e47e58661..17321cebc 100644
--- a/tests/xmltester/tests/general/TestOverlayLLPrec.xml
+++ b/tests/xmltester/tests/general/TestOverlayLLPrec.xml
@@ -72,29 +72,20 @@
 <test>
   <op name="difference" arg1="A" arg2="B">
     MULTILINESTRING(
-      (200 220, 177 237), 
-      (177 237, 153 253), 
-      (153 253, 60 320, 40 300, 133 233), 
-      (133 233, 157 217), 
-      (157 217, 180 200), 
-      (160 180, 137 197), 
-      (137 197, 113 213), 
-      (113 213, 20 280))
+      (200 220, 177 237, 153 253, 60 320, 40 300, 133 233, 157 217, 180 200), 
+      (160 180, 137 197, 113 213, 20 280))
   </op>
 </test>
 <test>
   <op name="symdifference" arg1="A" arg2="B">
     MULTILINESTRING(
-      (200 220, 177 237), 
+      (157 217, 180 200, 200 220, 177 237), 
       (177 237, 153 253), 
       (153 253, 60 320, 40 300, 133 233), 
       (133 233, 157 217), 
-      (157 217, 180 200), 
-      (160 180, 137 197), 
       (137 197, 113 213), 
       (113 213, 20 280), 
-      (200 220, 180 200), 
-      (160 180, 140 160, 120 180, 137 197), 
+      (137 197, 160 180, 140 160, 120 180, 137 197), 
       (137 197, 157 217), 
       (157 217, 177 237), 
       (177 237, 220 280, 200 300, 153 253), 
diff --git a/tests/xmltester/tests/general/TestOverlayPL.xml b/tests/xmltester/tests/general/TestOverlayPL.xml
index ba072db46..e47bd6bbf 100644
--- a/tests/xmltester/tests/general/TestOverlayPL.xml
+++ b/tests/xmltester/tests/general/TestOverlayPL.xml
@@ -108,8 +108,7 @@
     MULTILINESTRING(
       (100 320, 100 220), 
       (100 180, 200 180), 
-      (220 180, 220 320), 
-      (220 320, 160 320))
+      (220 180, 220 320, 160 320))
   </op>
 </test>
 <test>
@@ -120,8 +119,7 @@
       POINT(140 320), 
       LINESTRING(100 320, 100 220), 
       LINESTRING(100 180, 200 180), 
-      LINESTRING(220 180, 220 320), 
-      LINESTRING(220 320, 160 320))
+      LINESTRING(220 180, 220 320, 160 320)) 
   </op>
 </test>
 </case>
@@ -157,9 +155,7 @@
 <test>
   <op name="difference" arg1="A" arg2="B">
     MULTILINESTRING(
-      (-500 -140, -500 -280), 
-      (-500 -280, -320 -280, -320 -140), 
-      (-320 -140, -500 -140), 
+      (-500 -280, -320 -280, -320 -140, -500 -140, -500 -280), 
       (-500 -280, -500 -340))
   </op>
 </test>
@@ -170,13 +166,10 @@
       POINT(-420 -180), 
       POINT(-320 -120), 
       POINT(-280 -140), 
-      LINESTRING(-500 -140, -500 -280), 
-      LINESTRING(-500 -280, -320 -280, -320 -140), 
-      LINESTRING(-320 -140, -500 -140), 
+      LINESTRING(-500 -280, -320 -280, -320 -140, -500 -140, -500 -280), 
       LINESTRING(-500 -280, -500 -340))
   </op>
-</test>
-</case>
+</test> </case>
 
 <case>
   <desc>mPmL - points in I, B and E of lines, lines overlap, points overlap</desc>
@@ -217,8 +210,7 @@
     MULTILINESTRING(
       (100 320, 100 220), 
       (100 180, 200 180), 
-      (220 180, 220 320), 
-      (220 320, 160 320))
+      (220 180, 220 320, 160 320))
   </op>
 </test>
 <test>
@@ -229,8 +221,7 @@
       POINT(140 320), 
       LINESTRING(100 320, 100 220), 
       LINESTRING(100 180, 200 180), 
-      LINESTRING(220 180, 220 320), 
-      LINESTRING(220 320, 160 320))
+      LINESTRING(220 180, 220 320, 160 320)) 
   </op>
 </test>
 </case>
diff --git a/tests/xmltester/tests/issue/issue-geos-527.xml b/tests/xmltester/tests/issue/issue-geos-527.xml
index ba1b2f61e..ecbf20aeb 100644
--- a/tests/xmltester/tests/issue/issue-geos-527.xml
+++ b/tests/xmltester/tests/issue/issue-geos-527.xml
@@ -19,7 +19,7 @@ LINESTRING(
     </a>
     <test>
       <op name='union' arg1='A' >
-MULTILINESTRING ((1725064.13656044 4819094.70235069, 1725063 4819121), (1725063 4819121, 1725064.141830536 4819094.702276371), (1725064.13656044 4819094.70235069, 1725064.141830536 4819094.702276371), (1725064.141830536 4819094.702276371, 1725064.14183882 4819094.70208557, 1725064.13656044 4819094.70235069), (1725064.141830536 4819094.702276371, 1725064.14210362 4819094.70227252))
+MULTILINESTRING ((1725064.13656044 4819094.70235069, 1725063 4819121, 1725064.141830536 4819094.702276371), (1725064.13656044 4819094.70235069, 1725064.141830536 4819094.702276371), (1725064.141830536 4819094.702276371, 1725064.14183882 4819094.70208557, 1725064.13656044 4819094.70235069), (1725064.141830536 4819094.702276371, 1725064.14210362 4819094.70227252))
       </op>
     </test>
   </case>
diff --git a/tests/xmltester/tests/misc/makevalid.xml b/tests/xmltester/tests/misc/makevalid.xml
index bee4be4c7..b11a3462c 100644
--- a/tests/xmltester/tests/misc/makevalid.xml
+++ b/tests/xmltester/tests/misc/makevalid.xml
@@ -139,7 +139,7 @@
   <a>MULTIPOLYGON(((0 0,1 1,0 1,1 0,0 0)),((0.8 0.1,2 0.1,2 0.9,0.8 0.9,0.8 0.1)))</a>
   <test>
     <op name="makevalid" arg1="a">
-        GEOMETRYCOLLECTION(MULTIPOLYGON(((0 0,0.5 0.5,0.8 0.2,0.8 0.8,0.9 0.9,2 0.9,2 0.1,0.9 0.1,1 0,0 0)),((0 1,1 1,0.9 0.9,0.8 0.9,0.8 0.8,0.5 0.5,0 1))),MULTILINESTRING((0.8 0.1,0.9 0.1),(0.8 0.1,0.8 0.2)))
+        GEOMETRYCOLLECTION(MULTIPOLYGON(((0 0,0.5 0.5,0.8 0.2,0.8 0.8,0.9 0.9,2 0.9,2 0.1,0.9 0.1,1 0,0 0)),((0 1,1 1,0.9 0.9,0.8 0.9,0.8 0.8,0.5 0.5,0 1))),LINESTRING(0.8 0.2, 0.8 0.1,0.9 0.1))
     </op>
   </test>
 </case>
diff --git a/tests/xmltester/tests/misc/split.xml b/tests/xmltester/tests/misc/split.xml
index b884e529e..0a4a79445 100644
--- a/tests/xmltester/tests/misc/split.xml
+++ b/tests/xmltester/tests/misc/split.xml
@@ -1,49 +1,45 @@
 <run>
-<!--
-This test is to verify difference() can be used to split linestrings
-and multilinestring using a "cutter" linesting.
--->
 
 <case>
-  <desc>Line/line difference/split</desc>
+  <desc>Line/line split</desc>
   <a>LINESTRING(2 0,10 0,10 10,0 10,0 2)</a>
   <b>LINESTRING(-5 5, 15 5)</b>
 <test>
-  <op name="difference" arg1="a" arg2="b">
-  MULTILINESTRING((2 0,10 0,10 5),(10 5,10 10,0 10,0 5),(0 5,0 2))
+  <op name="split" arg1="a" arg2="b">
+  GEOMETRYCOLLECTION(LINESTRING(2 0,10 0,10 5),LINESTRING(10 5,10 10,0 10,0 5),LINESTRING(0 5,0 2))
   </op>
 </test>
 </case>
 
 <case>
-  <desc>Line/line difference/split with boundary intersection</desc>
+  <desc>Line/line split with boundary intersection</desc>
   <a>LINESTRING(2 0,10 0,10 10,0 10,0 2)</a>
   <b>LINESTRING(0 5, 10 5)</b>
 <test>
-  <op name="difference" arg1="a" arg2="b">
-  MULTILINESTRING((2 0,10 0,10 5),(10 5,10 10,0 10,0 5),(0 5,0 2))
+  <op name="split" arg1="a" arg2="b">
+  GEOMETRYCOLLECTION(LINESTRING(2 0,10 0,10 5),LINESTRING(10 5,10 10,0 10,0 5),LINESTRING(0 5,0 2))
   </op>
 </test>
 </case>
 
 <case>
-  <desc>Multiline/line difference/split</desc>
+  <desc>Multiline/line split</desc>
   <a>MULTILINESTRING((0 0, 0 10), (5 0, 5 10), (10 0, 10 10))</a>
   <b>LINESTRING(-5 5, 15 5)</b>
 <test>
-  <op name="difference" arg1="a" arg2="b">
-  MULTILINESTRING((0 0,0 5),(0 5,0 10),(5 0,5 5),(5 5,5 10),(10 0,10 5),(10 5,10 10))
+  <op name="split" arg1="a" arg2="b">
+  GEOMETRYCOLLECTION(LINESTRING(0 0,0 5),LINESTRING(0 5,0 10),LINESTRING(5 0,5 5),LINESTRING(5 5,5 10),LINESTRING(10 0,10 5),LINESTRING(10 5,10 10))
   </op>
 </test>
 </case>
 
 <case>
-  <desc>Multiline/line difference/split with boundary intersection</desc>
+  <desc>Multiline/line split with boundary intersection</desc>
   <a>MULTILINESTRING((0 0, 0 10), (5 0, 5 10), (10 0, 10 10))</a>
   <b>LINESTRING(0 5, 10 5)</b>
 <test>
-  <op name="difference" arg1="a" arg2="b">
-  MULTILINESTRING((0 0,0 5),(0 5,0 10),(5 0,5 5),(5 5,5 10),(10 0,10 5),(10 5,10 10))
+  <op name="split" arg1="a" arg2="b">
+  GEOMETRYCOLLECTION(LINESTRING(0 0,0 5),LINESTRING(0 5,0 10),LINESTRING(5 0,5 5),LINESTRING(5 5,5 10),LINESTRING(10 0,10 5),LINESTRING(10 5,10 10))
   </op>
 </test>
 </case>

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

Summary of changes:
 NEWS.md                                            |  2 ++
 src/operation/overlayng/LineBuilder.cpp            |  4 +--
 tests/unit/capi/GEOSDifferenceTest.cpp             |  2 +-
 tests/unit/operation/geounion/UnaryUnionOpTest.cpp |  3 ++
 .../operation/overlayng/CoverageUnionNGTest.cpp    | 19 +++++++------
 .../overlayng/OverlayNGGeometryCollectionTest.cpp  |  4 ++-
 tests/unit/operation/overlayng/OverlayNGTest.cpp   | 12 ++++----
 tests/unit/operation/overlayng/OverlayNGZTest.cpp  |  6 ++--
 .../operation/overlayng/PrecisionReducerTest.cpp   |  4 ++-
 .../operation/sharedpaths/SharedPathsOpTest.cpp    | 10 +++----
 tests/xmltester/XMLTester.cpp                      |  5 ++++
 tests/xmltester/tests/general/TestNGOverlayA.xml   |  5 ++--
 .../xmltester/tests/general/TestNGOverlayAPrec.xml | 11 ++++----
 tests/xmltester/tests/general/TestNGOverlayGC.xml  |  2 +-
 tests/xmltester/tests/general/TestNGOverlayL.xml   | 18 ++++++------
 .../xmltester/tests/general/TestNGOverlayLPrec.xml | 22 +++++++--------
 tests/xmltester/tests/general/TestOverlayAA.xml    | 24 ++++------------
 .../xmltester/tests/general/TestOverlayAAPrec.xml  | 23 ++++-----------
 tests/xmltester/tests/general/TestOverlayLA.xml    | 33 +++++++---------------
 tests/xmltester/tests/general/TestOverlayLL.xml    | 26 +++++------------
 .../xmltester/tests/general/TestOverlayLLPrec.xml  | 17 +++--------
 tests/xmltester/tests/general/TestOverlayPL.xml    | 23 +++++----------
 tests/xmltester/tests/issue/issue-geos-527.xml     |  2 +-
 tests/xmltester/tests/misc/makevalid.xml           |  2 +-
 tests/xmltester/tests/misc/split.xml               | 28 ++++++++----------
 25 files changed, 126 insertions(+), 181 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list