summaryrefslogtreecommitdiff
path: root/db/geo
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2010-09-02 18:05:46 -0400
committerMathias Stearn <mathias@10gen.com>2010-09-02 20:12:37 -0400
commit0f7906c1e56d65872fdbb32dddc400222efcaa54 (patch)
tree43597a0db42ed3b77e767ccebf17ead26dd9d319 /db/geo
parent0fe45dce90be8a3414e962460071a5e52afb0d2f (diff)
downloadmongo-0f7906c1e56d65872fdbb32dddc400222efcaa54.tar.gz
fix bug in Geo2dType::edgeSize() and add more debugging SERVER-1342
Diffstat (limited to 'db/geo')
-rw-r--r--db/geo/2d.cpp15
1 files changed, 13 insertions, 2 deletions
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<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;