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

svn_geos at osgeo.org svn_geos at osgeo.org
Wed Sep 30 16:27:47 EDT 2009


Author: strk
Date: 2009-09-30 16:27:47 -0400 (Wed, 30 Sep 2009)
New Revision: 2640

Modified:
   trunk/source/operation/buffer/BufferBuilder.cpp
Log:
Some debugging for single sided buffers


Modified: trunk/source/operation/buffer/BufferBuilder.cpp
===================================================================
--- trunk/source/operation/buffer/BufferBuilder.cpp	2009-09-30 19:18:20 UTC (rev 2639)
+++ trunk/source/operation/buffer/BufferBuilder.cpp	2009-09-30 20:27:47 UTC (rev 2640)
@@ -54,6 +54,9 @@
 #include <algorithm>
 #include <iostream>
 
+// Debug single sided buffer
+//#define GEOS_DEBUG_SSB 1
+
 #ifndef GEOS_DEBUG
 #define GEOS_DEBUG 0
 #endif
@@ -132,6 +135,11 @@
    // Create MultiLineStrings from this polygon.
    Geometry* bufLineString = buf->getBoundary();
 
+#ifdef GEOS_DEBUG_SSB
+   std::cerr << "input|" << *l << std::endl;
+   std::cerr << "fullBufferBoundary|" << *buf << std::endl;
+#endif
+
    // Then, get the raw (i.e. unnoded) single sided offset curve.
    OffsetCurveBuilder curveBuilder( precisionModel, modParams );
    std::vector< CoordinateSequence* > lineList;
@@ -156,8 +164,14 @@
       new std::vector< Geometry * >();
    for ( unsigned int i = 0; i < nodedEdges->size(); ++i )
    {
-      singleSidedNodedEdges->push_back( geomFact->createLineString(
-         ( *nodedEdges )[i]->getCoordinates() ) );
+     Geometry* tmp = geomFact->createLineString(
+         ( *nodedEdges )[i]->getCoordinates() );
+
+#ifdef GEOS_DEBUG_SSB
+     std::cerr << "nodedEdge" << i << "|" << *tmp << std::endl;
+#endif
+
+      singleSidedNodedEdges->push_back( tmp );
    }
    Geometry* singleSided = geomFact->createMultiLineString(
       singleSidedNodedEdges );
@@ -166,6 +180,10 @@
    // on both the butt-cap buffer and this multi-line.
    Geometry* intersectedLines = singleSided->intersection( bufLineString );
 
+#ifdef GEOS_DEBUG_SSB
+     std::cerr << "intersection" << "|" << *intersectedLines << std::endl;
+#endif
+
    // Merge result lines together.
    LineMerger lineMerge;
    lineMerge.add( intersectedLines );



More information about the geos-commits mailing list