From 0f7906c1e56d65872fdbb32dddc400222efcaa54 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Thu, 2 Sep 2010 18:05:46 -0400 Subject: fix bug in Geo2dType::edgeSize() and add more debugging SERVER-1342 --- db/geo/2d.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'db/geo') diff --git a/db/geo/2d.cpp b/db/geo/2d.cpp index 45d6d36ac3b..a87a0336792 100644 --- a/db/geo/2d.cpp +++ b/db/geo/2d.cpp @@ -249,6 +249,11 @@ namespace mongo { b.move( 1 , 1 ); unhash( a, ax, ay ); unhash( b, bx, by ); + + // _min and _max are a singularity + if (bx == _min) + bx = _max; + return (fabs(ax-bx)); } @@ -978,15 +983,21 @@ namespace mongo { for ( int i=0; i_error)) + if (_alreadyScanned.contains(testBox, _spec->_error)){ + GEODEBUG("skipping box: already scanned"); return; // been here, done this + } double intPer = testBox.intersects( want ); - if ( intPer <= 0 ) + if ( intPer <= 0 ){ + GEODEBUG("skipping box: not in want"); return; + } bool goDeeper = intPer < .5 && depth < 2; -- cgit v1.2.1