0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-28 07:59:02 +01:00

SERVER-12128 Inconsistent earth radius used in tests

Resolves #580
This commit is contained in:
Matt Kangas 2015-03-18 13:49:13 -04:00
parent 240d693c8f
commit 565f050f41
3 changed files with 5 additions and 4 deletions

View File

@ -78,8 +78,8 @@ for( var i = -1; i < 2; i++ ){
// Do nearSphere check
// Earth Radius
var eRad = 6371
// Earth Radius from geoconstants.h
var eRad = 6378.1
nearResults = db.geoarray2.find( { loc : { $nearSphere : center , $maxDistance : 500 /* km */ / eRad }, type : type } ).toArray()

View File

@ -28,7 +28,7 @@ for ( var test = 0; test < numTests; test++ ) {
Random.srand( 1337 + test );
var radius = 5000 * Random.rand(); // km
radius = radius / 6371; // radians;
radius = radius / 6378.1; // radians; earth radius from geoconstants.h
var numDocs = Math.floor( 400 * Random.rand() );
// TODO: Wrapping uses the error value to figure out what would overlap...
var bits = Math.floor( 5 + Random.rand() * 28 );

View File

@ -30,7 +30,8 @@
namespace mongo {
// Thanks, Wikipedia.
// Equatorial radius of earth.
// Source: http://nssdc.gsfc.nasa.gov/planetary/factsheet/earthfact.html
const double kRadiusOfEarthInMeters = (6378.1 * 1000);
} // namespace mongo