[geos-commits] [SCM] GEOS branch master updated. a8f66c6fae42acf9e526747fa1ee745de293f428
git at osgeo.org
git at osgeo.org
Thu May 23 07:52:00 PDT 2019
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, master has been updated
via a8f66c6fae42acf9e526747fa1ee745de293f428 (commit)
via 439b1f10cc2a75b728759be2c151ae772cb6a8fb (commit)
from b3d48db34c0b024fc660b94b22eb50ca299478b1 (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 a8f66c6fae42acf9e526747fa1ee745de293f428
Merge: b3d48db 439b1f1
Author: Daniel Baston <dbaston at gmail.com>
Date: Thu May 23 10:51:16 2019 -0400
Merge branch 'scaled-noder-fix'
commit 439b1f10cc2a75b728759be2c151ae772cb6a8fb
Author: Daniel Baston <dbaston at gmail.com>
Date: Wed May 22 21:42:18 2019 -0400
Fix handling of repeated points in ScaledNoder
diff --git a/src/noding/ScaledNoder.cpp b/src/noding/ScaledNoder.cpp
index 71747f4..57c5c28 100644
--- a/src/noding/ScaledNoder.cpp
+++ b/src/noding/ScaledNoder.cpp
@@ -20,6 +20,7 @@
#include <geos/geom/CoordinateSequence.h> // for apply and delete
#include <geos/geom/CoordinateFilter.h> // for inheritance
#include <geos/noding/ScaledNoder.h>
+#include <geos/noding/NodedSegmentString.h>
#include <geos/noding/SegmentString.h>
#include <geos/operation/valid/RepeatedPointRemover.h>
#include <geos/operation/valid/RepeatedPointTester.h>
@@ -154,10 +155,8 @@ void
ScaledNoder::scale(SegmentString::NonConstVect& segStrings) const
{
Scaler scaler(*this);
- for(SegmentString::NonConstVect::const_iterator
- i0 = segStrings.begin(), i0End = segStrings.end();
- i0 != i0End; ++i0) {
- SegmentString* ss = *i0;
+ for(size_t i = 0; i < segStrings.size(); i++) {
+ SegmentString* ss = segStrings[i];
CoordinateSequence* cs = ss->getCoordinates();
@@ -167,16 +166,11 @@ ScaledNoder::scale(SegmentString::NonConstVect& segStrings) const
cs->apply_rw(&scaler);
assert(cs->size() == npts);
- // Actually, we should be creating *new*
- // SegmentStrings here, but who's going
- // to delete them then ? And is it worth
- // the memory cost ?
operation::valid::RepeatedPointTester rpt;
if (rpt.hasRepeatedPoint(cs)) {
auto cs2 = operation::valid::RepeatedPointRemover::removeRepeatedPoints(cs);
- delete cs;
- cs = cs2.release();
- // FIXME
+ segStrings[i] = new NodedSegmentString(cs2.release(), ss->getData());
+ delete ss;
}
}
}
-----------------------------------------------------------------------
Summary of changes:
src/noding/ScaledNoder.cpp | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
hooks/post-receive
--
GEOS
More information about the geos-commits
mailing list