[geos-devel] nasty ring bug

Carl Anderson carl.anderson at vadose.org
Wed Feb 21 00:25:39 EST 2007


strk,

This patch avoids the defective logic (that exists later, somewhere)
It makes a logic short circuit more robust instead of fixing the 
underlying logic defect.

So be it.
It works for me..  for now.

I'll let you know how further testing goes.

bug_nasty.xml
and
hole_red.xml

both pass testing with this patch.


--- source/operation/buffer/SubgraphDepthLocater.cpp    (revision 1972)
+++ source/operation/buffer/SubgraphDepthLocater.cpp    (working copy)
@@ -180,11 +180,16 @@
        {
                BufferSubgraph *bsg=(*subgraphs)[i];
 
+#ifdef GEOS_DEBUG > 1
+       std::cerr << "findStabbedSegments envelope: " <<  
bsg->getEnvelope() << " RayLeftpt: " << stabbingRayLeftPt << std::endl;
+#endif
                // optimization - don't bother checking subgraphs
                // which the ray does not intersect
                Envelope *env = bsg->getEnvelope();
                if ( stabbingRayLeftPt.y < env->getMinY()
-                       || stabbingRayLeftPt.y > env->getMaxY() )
+                       || stabbingRayLeftPt.y > env->getMaxY()
+                       || stabbingRayLeftPt.x < env->getMinX()
+                       || stabbingRayLeftPt.x > env->getMaxX())
                                continue;
 
                findStabbedSegments(stabbingRayLeftPt, 
bsg->getDirectedEdges(),


C.






More information about the geos-devel mailing list