mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-28 07:59:02 +01:00
parent
240d693c8f
commit
565f050f41
@ -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()
|
||||
|
||||
|
@ -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 );
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user