[geos-commits] [SCM] GEOS branch main updated. 2ad56c719b0155256712357aa4f8e8a6e05ce8b7
git at osgeo.org
git at osgeo.org
Tue Jan 13 13:50: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 2ad56c719b0155256712357aa4f8e8a6e05ce8b7 (commit)
from 88e9956280f9dda33447137b0cc1c1ffb62d05ce (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 2ad56c719b0155256712357aa4f8e8a6e05ce8b7
Author: Daniel Baston <dbaston at gmail.com>
Date: Tue Jan 13 16:50:29 2026 -0500
LineDissolver: Create geometries with dimensions matching input (#1373)
* LineDissolver: Create geometries with dimensions matching input
* LineDissolver: Create CoordinateSequence as shared_ptr
diff --git a/include/geos/dissolve/LineDissolver.h b/include/geos/dissolve/LineDissolver.h
index cfae61f80..404e94bb3 100644
--- a/include/geos/dissolve/LineDissolver.h
+++ b/include/geos/dissolve/LineDissolver.h
@@ -83,6 +83,8 @@ private:
std::vector<std::unique_ptr<LineString>> lines;
std::stack<HalfEdge*> nodeEdgeStack;
DissolveHalfEdge* ringStartEdge = nullptr;
+ bool constructZ = false;
+ bool constructM = false;
void computeResult();
@@ -136,7 +138,7 @@ private:
void buildRing(HalfEdge* eStartRing);
- void addLine(std::unique_ptr<CoordinateSequence>& cs);
+ void addLine(const std::shared_ptr<CoordinateSequence>& cs);
public:
diff --git a/src/dissolve/LineDissolver.cpp b/src/dissolve/LineDissolver.cpp
index 3c1d808fb..257ea181a 100644
--- a/src/dissolve/LineDissolver.cpp
+++ b/src/dissolve/LineDissolver.cpp
@@ -88,6 +88,8 @@ void
LineDissolver::add(const LineString* lineString)
{
const CoordinateSequence* seq = lineString->getCoordinatesRO();
+ constructZ |= seq->hasZ();
+ constructM |= seq->hasM();
bool doneStart = false;
for (std::size_t i = 1; i < seq->size(); i++) {
@@ -200,7 +202,7 @@ LineDissolver::updateRingStartEdge(DissolveHalfEdge* e)
void
LineDissolver::buildLine(HalfEdge* eStart)
{
- std::unique_ptr<CoordinateSequence> line(new CoordinateSequence(0, 4));
+ auto line = std::make_shared<CoordinateSequence>(0, constructZ, constructM);
DissolveHalfEdge* e = static_cast<DissolveHalfEdge*>(eStart);
ringStartEdge = nullptr;
@@ -238,7 +240,7 @@ LineDissolver::buildLine(HalfEdge* eStart)
void
LineDissolver::buildRing(HalfEdge* eStartRing)
{
- std::unique_ptr<CoordinateSequence> line(new CoordinateSequence(0, 4));
+ auto line = std::make_shared<CoordinateSequence>(0, constructZ, constructM);
HalfEdge* e = eStartRing;
// add first node
@@ -265,9 +267,9 @@ LineDissolver::buildRing(HalfEdge* eStartRing)
/* private */
void
-LineDissolver::addLine(std::unique_ptr<CoordinateSequence>& cs)
+LineDissolver::addLine(const std::shared_ptr<CoordinateSequence>& cs)
{
- auto ls = factory->createLineString(std::move(cs));
+ auto ls = factory->createLineString(cs);
lines.emplace_back(ls.release());
}
diff --git a/tests/unit/coverage/CoverageCleanerTest.cpp b/tests/unit/coverage/CoverageCleanerTest.cpp
index f36f1f887..de0b634db 100644
--- a/tests/unit/coverage/CoverageCleanerTest.cpp
+++ b/tests/unit/coverage/CoverageCleanerTest.cpp
@@ -77,6 +77,8 @@ struct test_coveragecleaner_data {
{
ensure_equals("checkEqual sizes", actual.size(), expected.size());
for (std::size_t i = 0; i < actual.size(); i++) {
+ ensure_equals("hasZ does not match", actual[i]->hasZ(), expected[i]->hasZ());
+ ensure_equals("hasM does not match", actual[i]->hasM(), expected[i]->hasM());
ensure_equals_geometry(actual[i], expected[i]);
}
}
-----------------------------------------------------------------------
Summary of changes:
include/geos/dissolve/LineDissolver.h | 4 +++-
src/dissolve/LineDissolver.cpp | 10 ++++++----
tests/unit/coverage/CoverageCleanerTest.cpp | 2 ++
3 files changed, 11 insertions(+), 5 deletions(-)
hooks/post-receive
--
GEOS
More information about the geos-commits
mailing list