[geos-commits] [SCM] GEOS branch main updated. b896045021458077ae4c10e831b5d2461f54d3cc
git at osgeo.org
git at osgeo.org
Sat Mar 7 17:09:54 PST 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 b896045021458077ae4c10e831b5d2461f54d3cc (commit)
via e49be080abdc2ad8a9ce3abcede99a272207f22d (commit)
via 407e7f47888f91d386d3a42c18014bd524e13a94 (commit)
from 9f2be966553f6b81b69b1d2ec7aaf2b6bc3b79ac (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 b896045021458077ae4c10e831b5d2461f54d3cc
Author: Daniel Baston <dbaston at gmail.com>
Date: Sat Mar 7 20:09:09 2026 -0500
CircularString::getArcs: avoid underflow on empty CircularString
diff --git a/src/geom/CircularString.cpp b/src/geom/CircularString.cpp
index ac5311905..ebfdd765b 100644
--- a/src/geom/CircularString.cpp
+++ b/src/geom/CircularString.cpp
@@ -49,6 +49,10 @@ CircularString::clone() const
void
CircularString::createArcs() const
{
+ if (points->getSize() < 3) {
+ return;
+ }
+
for (std::size_t i = 0; i < points->getSize() - 2; i += 2) {
arcs.emplace_back(*points, i);
}
diff --git a/tests/unit/geom/CircularStringTest.cpp b/tests/unit/geom/CircularStringTest.cpp
index a4a9a9d14..045c61739 100644
--- a/tests/unit/geom/CircularStringTest.cpp
+++ b/tests/unit/geom/CircularStringTest.cpp
@@ -199,4 +199,16 @@ void object::test<5>()
ensure_THROW(factory_->createCircularString(pts), geos::util::GEOSException);
}
+template<>
+template<>
+void object::test<6>()
+{
+ set_test_name("getArcs on empty CircularString");
+
+ auto geom = factory_->createEmpty(geos::geom::GEOS_CIRCULARSTRING);
+
+ const auto& arcs = static_cast<const CircularString*>(geom.get())->getArcs();
+ ensure(arcs.empty());
+}
+
}
commit e49be080abdc2ad8a9ce3abcede99a272207f22d
Author: Daniel Baston <dbaston at gmail.com>
Date: Tue Dec 23 10:50:00 2025 -0500
CoordinateSequence: Add comments
diff --git a/include/geos/geom/CoordinateSequence.h b/include/geos/geom/CoordinateSequence.h
index 249e9ddd7..c284b9bc2 100644
--- a/include/geos/geom/CoordinateSequence.h
+++ b/include/geos/geom/CoordinateSequence.h
@@ -579,8 +579,10 @@ public:
void add(const CoordinateSequence& cl, bool allowRepeated, bool forwardDirection);
+ /// Add the portion of a CoordinateSequence between the specified indices (inclusive)
void add(const CoordinateSequence& cs, std::size_t from, std::size_t to);
+ /// Add the portion of a CoordinateSequence between the specified indices (inclusive)
void add(const CoordinateSequence& cs, std::size_t from, std::size_t to, bool allowRepeated);
template<typename T, typename... Args>
commit 407e7f47888f91d386d3a42c18014bd524e13a94
Author: Daniel Baston <dbaston at gmail.com>
Date: Mon Dec 22 14:34:29 2025 -0500
Add test for CurvePolygon area
diff --git a/tests/unit/geom/CurvePolygonTest.cpp b/tests/unit/geom/CurvePolygonTest.cpp
index 0ee7d4baa..774a8bb32 100644
--- a/tests/unit/geom/CurvePolygonTest.cpp
+++ b/tests/unit/geom/CurvePolygonTest.cpp
@@ -9,6 +9,7 @@
#include <geos/io/WKTReader.h>
using geos::geom::CoordinateXY;
+using geos::geom::CurvePolygon;
namespace tut {
@@ -183,4 +184,18 @@ void object::test<3>()
ensure_THROW(cc3->normalize(), geos::util::UnsupportedOperationException);
}
+template<>
+template<>
+void object::test<4>()
+{
+ set_test_name("getArea");
+
+ // SELECT ST_Area(ST_CurveToLine('CURVEPOLYGON (CIRCULARSTRING(0 0,0 2,1 2,1 1,2 1,3 0,0 0))', 36000));
+ auto cp = wktreader_.read<CurvePolygon>("CURVEPOLYGON (CIRCULARSTRING(0 0,0 2,1 2,1 1,2 1,3 0,0 0))");
+ ensure_equals("cp->getArea()", cp->getArea(), 9.8185835, 1e-6);
+
+ auto cpRev = cp->reverse();
+ ensure_equals("cpRev->getArea()", cpRev->getArea(), 9.8185835, 1e-6);
+}
+
}
-----------------------------------------------------------------------
Summary of changes:
include/geos/geom/CoordinateSequence.h | 2 ++
src/geom/CircularString.cpp | 4 ++++
tests/unit/geom/CircularStringTest.cpp | 12 ++++++++++++
tests/unit/geom/CurvePolygonTest.cpp | 15 +++++++++++++++
4 files changed, 33 insertions(+)
hooks/post-receive
--
GEOS
More information about the geos-commits
mailing list