[geos-commits] r2644 - trunk/source/operation/buffer

svn_geos at osgeo.org svn_geos at osgeo.org
Thu Oct 1 03:23:13 EDT 2009


Author: strk
Date: 2009-10-01 03:23:07 -0400 (Thu, 01 Oct 2009)
New Revision: 2644

Modified:
   trunk/source/operation/buffer/BufferBuilder.cpp
Log:
Use FLAT/BUTT endcaps when doing single sided buffering


Modified: trunk/source/operation/buffer/BufferBuilder.cpp
===================================================================
--- trunk/source/operation/buffer/BufferBuilder.cpp	2009-10-01 07:06:36 UTC (rev 2643)
+++ trunk/source/operation/buffer/BufferBuilder.cpp	2009-10-01 07:23:07 UTC (rev 2644)
@@ -131,8 +131,17 @@
    // First, generate the two-sided buffer using a butt-cap.
    BufferParameters modParams = bufParams;
    modParams.setEndCapStyle(BufferParameters::CAP_FLAT); 
-   Geometry* buf = buffer( l, distance );
+   Geometry* buf = 0;
 
+   // This is a (temp?) hack to workaround the fact that
+   // BufferBuilder BufferParamaters are immutable after
+   // construction, while we want to force the end cap
+   // style to FLAT for single-sided buffering
+   {
+      BufferBuilder tmp(modParams);
+      buf = tmp.buffer( l, distance );
+   }
+
    // Create MultiLineStrings from this polygon.
    Geometry* bufLineString = buf->getBoundary();
 



More information about the geos-commits mailing list