Skip to content
Browse files

fix bug in Geo2dType::edgeSize() and add more debugging SERVER-1342

  • Loading branch information...
1 parent 0fe45dc commit 0f7906c1e56d65872fdbb32dddc400222efcaa54 @RedBeard0531 RedBeard0531 committed
Showing with 13 additions and 2 deletions.
  1. +13 −2 db/geo/2d.cpp
View
15 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<depth; i++ )
cout << "\t";
cout << " doBox: " << testBox.toString() << "\t" << toscan.toString() << " scanned so far: " << _nscanned << endl;
+ } else {
+ GEODEBUGPRINT(testBox.toString());
}
- if (_alreadyScanned.contains(testBox, _spec->_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;

0 comments on commit 0f7906c

Please sign in to comment.
Something went wrong with that request. Please try again.