[geos-commits] [SCM] GEOS branch 3.11 updated. 2d2febc50e3e61af5d0ebe56d689613417d7a36a

git at osgeo.org git at osgeo.org
Sun Jan 14 12:49:24 PST 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, 3.11 has been updated
       via  2d2febc50e3e61af5d0ebe56d689613417d7a36a (commit)
      from  e2d99091724171ffb0d8716739580bac7d355780 (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 2d2febc50e3e61af5d0ebe56d689613417d7a36a
Author: Mike Taves <mwtoews at gmail.com>
Date:   Mon Jan 15 09:47:45 2024 +1300

    Fix StringTokenizer::peekNextToken (#1025)

diff --git a/NEWS.md b/NEWS.md
index b48a7b69f..c368a0ad0 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -6,6 +6,7 @@ xxxx-xx-xx
   - Fix DiscreteHausdorffDistance for LinearRing (GH-1000, Martin Davis)
   - PointOnSurface crashes with a collection containing a empty linestring (GH-1002, Paul Ramsey)
   - Fix IsSimpleOp for MultiPoint with empty element (GH-1005, Martin Davis)
+  - Fix reading WKT with EMPTY token with white space (GH-1025, Mike Taves)
   
 ## Changes in 3.11.3
 2023-11-11
diff --git a/src/io/StringTokenizer.cpp b/src/io/StringTokenizer.cpp
index 5735913cc..e016299eb 100644
--- a/src/io/StringTokenizer.cpp
+++ b/src/io/StringTokenizer.cpp
@@ -154,10 +154,8 @@ StringTokenizer::peekNextToken()
         return str[pos];
     }
 
-    // It's either a Number or a Word, let's
-    // see when it ends
-
-    pos = str.find_first_of("\n\r\t() ,", static_cast<string::size_type>(iter - str.begin()));
+    // It's either a Number or a Word, let's see when it ends
+    pos = str.find_first_of("\n\r\t() ,", pos + 1);
 
     if(pos == string::npos) {
         if(iter != str.end()) {
diff --git a/tests/unit/io/WKTReaderTest.cpp b/tests/unit/io/WKTReaderTest.cpp
index 477f3cb08..245d67e42 100644
--- a/tests/unit/io/WKTReaderTest.cpp
+++ b/tests/unit/io/WKTReaderTest.cpp
@@ -317,4 +317,15 @@ void object::test<13>
 
 
 
+// EMPTY token with some white space
+template<>
+template<>
+void object::test<14>
+()
+{
+    GeomPtr geom(wktreader.read("MULTIPOINT( EMPTY, (10 10), (20 20))"));
+
+    ensure_equals(geom->getNumGeometries(), 3u);
+}
+
 } // namespace tut

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

Summary of changes:
 NEWS.md                         |  1 +
 src/io/StringTokenizer.cpp      |  6 ++----
 tests/unit/io/WKTReaderTest.cpp | 11 +++++++++++
 3 files changed, 14 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list