[geos-commits] [SCM] GEOS branch 3.11 updated. bc2a209e3f05b06325701f68d7a1930c50773bd8

git at osgeo.org git at osgeo.org
Mon May 8 13:35:28 PDT 2023


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  bc2a209e3f05b06325701f68d7a1930c50773bd8 (commit)
      from  f0adf3ab45bd12c76268fd0b9a09d2d0781d73da (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 bc2a209e3f05b06325701f68d7a1930c50773bd8
Author: Martin Davis <mtnclimb at gmail.com>
Date:   Mon May 8 13:16:41 2023 -0700

    Fix OffsetCurve EndCap parameter handling (#899)

diff --git a/capi/geos_ts_c.cpp b/capi/geos_ts_c.cpp
index 150137a58..ae3a4f2d9 100644
--- a/capi/geos_ts_c.cpp
+++ b/capi/geos_ts_c.cpp
@@ -1167,7 +1167,7 @@ extern "C" {
     {
         return execute(extHandle, [&]() {
             BufferParameters bp;
-            bp.setEndCapStyle(BufferParameters::CAP_FLAT);
+            //-- use default cap style ROUND 
             bp.setQuadrantSegments(quadsegs);
 
             if(joinStyle > BufferParameters::JOIN_BEVEL) {
diff --git a/include/geos/operation/buffer/OffsetCurve.h b/include/geos/operation/buffer/OffsetCurve.h
index f584c3b23..b41285cfd 100644
--- a/include/geos/operation/buffer/OffsetCurve.h
+++ b/include/geos/operation/buffer/OffsetCurve.h
@@ -219,13 +219,16 @@ public:
     OffsetCurve(const Geometry& geom, double dist, BufferParameters& bp)
         : inputGeom(geom)
         , distance(dist)
-        , bufferParams(bp)
         , matchDistance(std::abs(dist)/NEARNESS_FACTOR)
         , geomFactory(geom.getFactory())
         {
             if (!std::isfinite(dist)) {
                 throw util::IllegalArgumentException("OffsetCurve distance must be a finite value");
             }
+            //-- set buffer params, leaving cap style as the default CAP_ROUND
+            bufferParams.setQuadrantSegments( bp.getQuadrantSegments());
+            bufferParams.setJoinStyle( bp.getJoinStyle());
+            bufferParams.setMitreLimit( bp.getMitreLimit());
         };
 
     /**
diff --git a/tests/unit/capi/GEOSOffsetCurveTest.cpp b/tests/unit/capi/GEOSOffsetCurveTest.cpp
index ccda8f0ce..c2ab6805c 100644
--- a/tests/unit/capi/GEOSOffsetCurveTest.cpp
+++ b/tests/unit/capi/GEOSOffsetCurveTest.cpp
@@ -132,7 +132,7 @@ void object::test<5>()
         "LINESTRING(33282908 6005055,33282900 6005050,33282892 6005042,33282876 6005007,33282863 6004982,33282866 6004971,33282876 6004975,33282967 6005018,33282999 6005031)",
         // Old algorithm
         // "LINESTRING EMPTY",
-        "LINESTRING (33282915.823395286 6005042.482567544, 33282948.754269265 6005058.043310193, 33282949.87329309 6005058.534544426, 33282982.439409934 6005071.764529393)",
+        "LINESTRING (33282939.63869393 6005053.735950421, 33282948.754269257 6005058.043310191, 33282949.873293087 6005058.534544423, 33282982.439409934 6005071.764529393)",
         44, 1, GEOSBUF_JOIN_MITRE, 1,
         0.000001
         );
@@ -246,5 +246,19 @@ void object::test<11>()
         );
 }
 
+// Test negative offset
+// See https://github.com/libgeos/geos/issues/897
+template<>
+template<>
+void object::test<12>()
+{
+    checkOffset(
+        "LINESTRING (292671.05 7336734.42, 292624.85 7336739.72, 292623.53 7336739.92, 292622.36 7336740.2, 292621.35 7336740.57, 292620.94 7336740.78, 292620.61 7336740.97, 292620.33 7336741.14, 292620.13 7336741.29, 292619.79 7336741.57, 292619.48 7336741.86, 292619.34 7336742.01, 292619.21 7336742.17, 292619.09 7336742.34, 292618.98 7336742.51, 292618.8 7336742.88, 292618.63 7336743.25, 292618.57 7336743.43, 292618.52 7336743.58, 292618.48 7336743.71, 292618.46 7336743.8, 292618.44 7336743.98, 292618.42 7336744.15, 292618.41 7336744.33, 292618.4 7336744.51, 292618.39 7336744.69, 292618.38 7336744.88, 292618.38 7336744.91, 292618.38 7336744.95, 292618.38 7336744.99, 292618.38 7336745.02, 292618.38 7336745.06, 292618.38 7336745.1, 292618.38 7336745.13, 292618.38 7336745.17, 292618.38 7336745.21, 292618.38 7336745.25, 292618.38 7336745.43, 292618.41 7336746.92)",
+        "LINESTRING (292672.7595667329 7336749.322260955, 292631.53009245027 7336754.052049131)",
+        -15, 8, GEOSBUF_JOIN_ROUND, 0,
+        0.000001
+        );
+}
+
 } // namespace tut
 

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

Summary of changes:
 capi/geos_ts_c.cpp                          |  2 +-
 include/geos/operation/buffer/OffsetCurve.h |  5 ++++-
 tests/unit/capi/GEOSOffsetCurveTest.cpp     | 16 +++++++++++++++-
 3 files changed, 20 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list