[geos-commits] [SCM] GEOS branch 3.7 updated. 45b28eb41288e31c7d489ee765ae633034efee94

git at osgeo.org git at osgeo.org
Wed Feb 5 10:57:33 PST 2020


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, 3.7 has been updated
       via  45b28eb41288e31c7d489ee765ae633034efee94 (commit)
      from  b363b501d5ceeecee3eba51277adecf975308174 (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 45b28eb41288e31c7d489ee765ae633034efee94
Author: Dan Baston <dbaston at gmail.com>
Date:   Thu Jan 30 10:32:25 2020 -0500

    Retain component order in MultiLineString::reverse
    
    Updated for consistency with the behavior of other geometry types (as
    changed in https://github.com/locationtech/jts/pull/513)
    
    Fixes #1013

diff --git a/NEWS b/NEWS
index 3e0dee5..de74976 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,8 @@ Changes in 3.7.3dev
 - Bug fixes / improvements
   - Union performance regression (#867, Paul Ramsey)
   - Overlay performance improvement (#986, Paul Ramsey)
+  - Avoid changing MultiLineString component order in GEOSReverse
+    (#1013, Dan Baston)
 
 
 Changes in 3.7.2
diff --git a/src/geom/MultiLineString.cpp b/src/geom/MultiLineString.cpp
index 3aab661..b9c5d2d 100644
--- a/src/geom/MultiLineString.cpp
+++ b/src/geom/MultiLineString.cpp
@@ -119,7 +119,7 @@ MultiLineString::reverse() const
 	{
 		LineString *iLS = dynamic_cast<LineString*>((*geometries)[i]);
 		assert(iLS);
-		(*revLines)[nLines-1-i] = iLS->reverse();
+		(*revLines)[i] = iLS->reverse();
 	}
 	return getFactory()->createMultiLineString(revLines);
 }
diff --git a/tests/unit/capi/GEOSReverseTest.cpp b/tests/unit/capi/GEOSReverseTest.cpp
index 30d629d..4bf9ce8 100644
--- a/tests/unit/capi/GEOSReverseTest.cpp
+++ b/tests/unit/capi/GEOSReverseTest.cpp
@@ -91,7 +91,7 @@ namespace tut
     void object::test<4>()
     {
         testReverse("MULTILINESTRING ((1 1, 2 2), (3 3, 4 4))",
-                    "MULTILINESTRING ((4 4, 3 3), (2 2, 1 1))");
+                    "MULTILINESTRING ((2 2, 1 1), (4 4, 3 3))");
     }
 
     template<>
diff --git a/tests/unit/linearref/LengthIndexedLineTest.cpp b/tests/unit/linearref/LengthIndexedLineTest.cpp
index 23c5e3a..efc7df1 100644
--- a/tests/unit/linearref/LengthIndexedLineTest.cpp
+++ b/tests/unit/linearref/LengthIndexedLineTest.cpp
@@ -297,7 +297,7 @@ template<>
 void object::test<16>()
 {
     checkExtractLine("MULTILINESTRING ((0 0, 10 0), (20 0, 25 0, 30 0))",
-                     19, 1, "MULTILINESTRING ((29 0, 25 0, 20 0), (10 0, 1 0))");
+                     19, 1, "MULTILINESTRING ((10 0, 1 0), (29 0, 25 0, 20 0))");
 }
 
 // testExtractLineNegative()

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

Summary of changes:
 NEWS                                           | 2 ++
 src/geom/MultiLineString.cpp                   | 2 +-
 tests/unit/capi/GEOSReverseTest.cpp            | 2 +-
 tests/unit/linearref/LengthIndexedLineTest.cpp | 2 +-
 4 files changed, 5 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list