[geos-commits] [SCM] GEOS branch 3.13 updated. 06715295d1974cc0e19b5d519a52ee85cc1991af
git at osgeo.org
git at osgeo.org
Thu Nov 21 09:16:22 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.13 has been updated
via 06715295d1974cc0e19b5d519a52ee85cc1991af (commit)
via b554b0a1ef10559b9495ac5575e470774c55bc49 (commit)
from 29e3f0583318fa194d1b27fcf35497bb8c312b48 (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 06715295d1974cc0e19b5d519a52ee85cc1991af
Author: Martin Davis <mtnclimb at gmail.com>
Date: Thu Nov 21 09:15:59 2024 -0800
Update NEWS
diff --git a/NEWS.md b/NEWS.md
index 6eb86f277..31d66733d 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -7,7 +7,7 @@
- Fix LineString->getPoint(n) for M geometries (GH-1191, @hsieyuan)
- Fix TopologyPreservingSimplifier/TaggedLineString to avoid jumping components (JTS-1096, Martin Davis)
- Fix WKTWriter for small precisions and with trim enabled (GH-1199, Mike Taves)
-
+ - Fix BufferOp to increase length of segments removed by heuristic (GH-1200, Martin Davis)
## Changes in 3.13.0
2024-09-06
commit b554b0a1ef10559b9495ac5575e470774c55bc49
Author: Martin Davis <mtnclimb at gmail.com>
Date: Wed Nov 20 15:56:35 2024 -0800
Increase length of segments removed by BufferOp short segment removal heuristic (#1200)
diff --git a/src/operation/buffer/OffsetSegmentGenerator.cpp b/src/operation/buffer/OffsetSegmentGenerator.cpp
index 4537f9b3d..6c7c2c3b0 100644
--- a/src/operation/buffer/OffsetSegmentGenerator.cpp
+++ b/src/operation/buffer/OffsetSegmentGenerator.cpp
@@ -44,7 +44,7 @@ namespace operation { // geos.operation
namespace buffer { // geos.operation.buffer
/*private data*/
-const double OffsetSegmentGenerator::CURVE_VERTEX_SNAP_DISTANCE_FACTOR = 1.0E-6;
+const double OffsetSegmentGenerator::CURVE_VERTEX_SNAP_DISTANCE_FACTOR = 1.0E-4;
const double OffsetSegmentGenerator::OFFSET_SEGMENT_SEPARATION_FACTOR = 1.0E-3;
const double OffsetSegmentGenerator::INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR = 1.0E-3;
const double OffsetSegmentGenerator::SIMPLIFY_FACTOR = 100.0;
diff --git a/tests/unit/operation/buffer/BufferOpTest.cpp b/tests/unit/operation/buffer/BufferOpTest.cpp
index 478704424..f1894c4ef 100644
--- a/tests/unit/operation/buffer/BufferOpTest.cpp
+++ b/tests/unit/operation/buffer/BufferOpTest.cpp
@@ -59,6 +59,13 @@ struct test_bufferop_data {
ensure_equals_geometry(expected.get(), actual.get(), tolerance);
}
+ void checkBufferValid(const Geometry& buffer)
+ {
+ ensure_not(buffer.isEmpty());
+ ensure(buffer.isValid());
+ ensure_equals(buffer.getGeometryTypeId(), geos::geom::GEOS_POLYGON);
+ }
+
private:
// noncopyable
test_bufferop_data(test_bufferop_data const& other) = delete;
@@ -70,6 +77,9 @@ typedef group::object object;
group test_bufferop_group("geos::operation::buffer::BufferOp");
+using geos::operation::buffer::BufferOp;
+using geos::operation::buffer::BufferParameters;
+
//
// Test Cases
//
@@ -180,7 +190,7 @@ void object::test<4>
ensure_not(gBuffer->isEmpty());
ensure(gBuffer->isValid());
ensure_equals(gBuffer->getGeometryTypeId(), geos::geom::GEOS_POLYGON);
- ensure(gBuffer->getNumPoints() >= std::size_t(243));
+ ensure(gBuffer->getNumPoints() >= std::size_t(240));
}
// Buffer point with custom parameters: 32 quadrant segments
@@ -193,7 +203,7 @@ void object::test<4>
ensure_not(gBuffer->isEmpty());
ensure(gBuffer->isValid());
ensure_equals(gBuffer->getGeometryTypeId(), geos::geom::GEOS_POLYGON);
- ensure(gBuffer->getNumPoints() >= std::size_t(317));
+ ensure(gBuffer->getNumPoints() >= std::size_t(310));
}
}
@@ -582,9 +592,6 @@ template<>
void object::test<21>
()
{
- using geos::operation::buffer::BufferOp;
- using geos::operation::buffer::BufferParameters;
-
std::string wkt("LINESTRING (50 50, 150 150, 150 100, 150 0)");
GeomPtr geom(wktreader.read(wkt));
@@ -603,9 +610,6 @@ template<>
void object::test<22>
()
{
- using geos::operation::buffer::BufferOp;
- using geos::operation::buffer::BufferParameters;
-
std::string wkt("MULTILINESTRING((0 0,10 0),(20 0,30 0))");
GeomPtr geom(wktreader.read(wkt));
@@ -622,7 +626,7 @@ void object::test<22>
// See https://github.com/libgeos/geos/issues/984
template<>
template<>
-void object::test<24>
+void object::test<23>
()
{
std::string wkt("MULTIPOLYGON (((833454.7163917861 6312507.405413097, 833455.3726665961 6312510.208920742, 833456.301153878 6312514.207390314, 833492.2432584754 6312537.770332065, 833493.0901320165 6312536.098774815, 833502.6580673696 6312517.561360772, 833503.9404352929 6312515.0542803425, 833454.7163917861 6312507.405413097)))");
@@ -633,19 +637,26 @@ void object::test<24>
"POLYGON ((833489.57 6312527.65, 833493.27 6312520.48, 833474.09 6312517.5, 833489.57 6312527.65))");
}
-// Checks a bug in the inverted-ring-removal heuristic.
-// See https://github.com/libgeos/geos/issues/984
+// Test that hole is not removed
+// See https://github.com/libgeos/geos/issues/1125
template<>
template<>
-void object::test<23>
+void object::test<24>
()
{
- std::string wkt("POLYGON ((182719.04521570954238996 224897.14115349075291306, 182807.02887436276068911 224880.64421749324537814, 182808.47314301913138479 224877.25002362736267969, 182718.38701137207681313 224740.00115247094072402, 182711.82697281913715415 224742.08599378637154587, 182717.1393717635946814 224895.61432328051887453, 182719.04521570954238996 224897.14115349075291306))");
+ std::string wkt("POLYGON ((-148960.4047102984 6579513.659170938, -148960.40472686838 6579513.659178669, -148928.03967482893 6581180.350337844, -148928.03966852615 6581180.350346942, -148245.02969243884 6581451.972863571, -147792.69963135064 6581746.752366657, -147792.6996281087 6581746.75236803, -147401.9935951374 6581835.620705241, -147401.99358759282 6581835.620703953, -147210.88713389705 6581715.340857458, -147165.89526002048 6581718.457445952, -147051.42048342412 6581994.82400416, -147051.42047801215 6581994.824009572, -146383.20456979086 6582271.608101351, -146383.2045621372 6582271.608101351, -145714.9886539159 6581994.824009572, -145714.98864850393 6581994.82400416, -145614.3328321268 6581751.81936713, -145289.9656757827 6581774.313793615, -145289.96567191236 6581774.313793121, -145251.8481577967 6581761.535459794, -144930.85554023445 6582023.4300059695, -144930.8555367881 6582023.430007799, -144801.3009401439 6582062.324496457, -144649.32384133 6582200.989150884, -144370
.3984315592 6582625.9565866, -144433.62831761822 6582865.175298614, -144433.62831293597 6582865.175309839, -144433.62830087988 6582865.1753082415, -144245.21925235502 6582676.803615549, -144190.80928433637 6582650.465391226, -143612.84111918643 6583156.44930699, -143612.84111246275 6583156.449309465, -142975.83638491016 6583147.740068783, -141662.4868993248 6583201.722187021, -141223.96080949655 6583368.877976318, -141223.9608054673 6583368.877976963, -140134.4210790951 6583317.8899636455, -140134.42107909513 6583317.889963645, -137814.40233039632 6583217.2880082, -136584.74750083112 6583197.764297265, -135440.77723332949 6583205.617226817, -135255.13230017386 6583263.689926113, -135255.1322874622 6583263.689918893, -135023.5892295815 6582294.773116073, -135023.58923119382 6582294.773107903, -135333.80239165394 6581864.15594604, -135352.36463803763 6581737.195077398, -134265.49708795475 6581601.806141964, -134265.49708081497 6581601.806137504, -134171.3523981878 6581457.46162037, -1
34171.35240780914 6581457.4616049845, -135439.245418129 6581616.60978835, -135680.42426776656 6581646.652416545, -136232.90414847215 6581417.807757019, -136232.90415612582 6581417.807757019, -136858.6936574759 6581677.018255669, -136858.69366288788 6581677.018261081, -136920.3618271267 6581825.898379553, -138060.72504339425 6581967.9663254, -138065.18111364308 6581962.887381392, -138068.72527594457 6581957.509990996, -137927.47673027252 6581707.240836958, -137927.47673406618 6581707.240823334, -137979.72909077935 6581677.750295738, -137979.72910440317 6581677.750299531, -138121.13853298384 6581928.304511579, -138125.10691371575 6581928.045277543, -138155.67609864438 6581921.76382738, -138155.67610616024 6581921.763828826, -138161.59059580622 6581925.661985681, -138170.61370458457 6581926.915141124, -138241.97873011595 6581930.376670242, -138796.47362546774 6581702.31578339, -138796.4736332052 6581702.315783444, -138854.7945810144 6581727.268948418, -138854.7945866605 6581727.2689547
44, -138922.92405045434 6581954.795890863, -138946.81598659043 6581964.415299832, -139938.37021206832 6581949.812276196, -139938.37021590595 6581949.8122769, -139952.45944601868 6581955.406602237, -140868.02751450587 6581942.0008049095, -140881.4916733481 6581925.799231012, -140881.49167358445 6581925.799230739, -141370.63531269276 6581378.759410803, -140611.15578010492 6581049.475868011, -139690.6039796629 6580651.269214067, -139690.6039740706 6580651.269201963, -139690.6039854776 6580651.26919506, -140701.38102713643 6580840.959071666, -140701.38102925656 6580840.959072313, -141466.34649523295 6581171.308880125, -141779.4716785676 6581271.496083775, -141779.47168395555 6581271.496087928, -142011.00982111954 6581635.151647786, -142357.03529463548 6581674.463073463, -142838.53214036624 6581404.193867828, -142879.22309585733 6581262.508441415, -142930.87215587177 6580987.212409333, -142930.8721639988 6580987.212401323, -143534.53311040023 6580882.981192067, -143534.5331217403 6580882
.981204585, -143430.70804648325 6581258.626694803, -143473.24119568476 6581352.886713272, -143473.2411965649 6581352.886717073, -143492.189997855 6581960.431913559, -144142.7852635694 6582035.092757561, -144146.60337361123 6581637.42813556, -144146.60337730165 6581637.428127897, -144191.08019920863 6581601.260212262, -144191.08020840262 6581601.260210446, -144537.4404387965 6581705.616846219, -144590.7462798729 6581606.573062022, -144590.74628235682 6581606.573059013, -144763.58672583086 6581465.554334507, -144954.4193364253 6580944.824930562, -144954.4193514073 6580944.824925713, -145151.23516818596 6581077.603406857, -145568.85454308268 6581011.191119298, -145714.98864850393 6580658.392180065, -145714.9886539159 6580658.392174653, -146383.2045621372 6580381.608082874, -146383.20457111226 6580381.60808354, -147120.06182640104 6580824.10705606, -148440.15106589507 6579967.272987214, -148960.4047102984 6579513.659170938), (-136955.57204480894 6581910.9033646155, -137006.19393013295 6
582033.115406717, -137716.57054709445 6582951.997026325, -138024.97011972597 6582044.130380035, -136955.57204480894 6581910.9033646155), (-141937.5472958841 6582399.340443012, -141701.90518838447 6583118.585420219, -142423.0688508369 6583134.765513478, -142134.02124709485 6582436.3483778415, -141937.5472958841 6582399.340443012), (-143109.90838714276 6582619.958906428, -142984.15380482498 6583123.4834393775, -143587.23570536837 6583134.1575379195, -143327.76121576456 6582574.317213843, -143109.90838714276 6582619.958906428))");
+ GeomPtr geom(wktreader.read(wkt));
- checkBuffer(wkt, -5, 0.1,
- "POLYGON ((182722 224891.5, 182802 224876.5, 182717 224747, 182722 224891.5))");
- checkBuffer(wkt, -30, 0.1,
- "POLYGON ((182745.98 224861.57, 182760.51 224858.84, 182745.07 224835.33, 182745.98 224861.57))");
+ geos::operation::buffer::BufferParameters bp;
+ bp.setQuadrantSegments(1);
+ geos::operation::buffer::BufferOp op(geom.get(), bp);
+
+ std::unique_ptr<Geometry> result = op.getResultGeometry(0.00001);
+
+ checkBufferValid(*result);
+ ensure_equals(result->getNumGeometries(), 1u);
+ const Polygon* poly = dynamic_cast<const Polygon*>( result.get() );
+ ensure_equals(poly->getNumInteriorRing(), 3u);
}
} // namespace tut
-----------------------------------------------------------------------
Summary of changes:
NEWS.md | 2 +-
src/operation/buffer/OffsetSegmentGenerator.cpp | 2 +-
tests/unit/operation/buffer/BufferOpTest.cpp | 45 +++++++++++++++----------
3 files changed, 30 insertions(+), 19 deletions(-)
hooks/post-receive
--
GEOS
More information about the geos-commits
mailing list