Skip to content

Commit 0335a4c

Browse files
author
Michael Paik
committed
PR 1470
1 parent 648661f commit 0335a4c

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

source/reference/operator/query/centerSphere.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ Example
4949
The following example queries grid coordinates and returns all
5050
documents within a 10 mile radius of longitude ``88 W`` and latitude
5151
``30 N``. The query converts the distance to radians by dividing by the
52-
approximate radius of the earth, 3959 miles:
52+
approximate equatorial radius of the earth, 3963.2 miles:
5353

5454
.. code-block:: javascript
5555

5656
db.places.find( {
57-
loc: { $geoWithin: { $centerSphere: [ [ -88, 30 ], 10/3959 ] } }
57+
loc: { $geoWithin: { $centerSphere: [ [ -88, 30 ], 10/3963.2 ] } }
5858
} )

source/tutorial/calculate-distances-using-spherical-geometry-with-2d-geospatial-indexes.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ geometry:
3838
of the sphere (e.g. the Earth) in the units system that you want to
3939
convert the distance to.
4040

41-
The radius of the Earth is approximately ``3,959`` miles or
42-
``6,371`` kilometers.
41+
The equatorial radius of the Earth is approximately ``3,963.2``
42+
miles or ``6,378.1`` kilometers.
4343

4444
The following query would return documents from the ``places``
4545
collection within the circle described by the center ``[ -74, 40.74 ]``
@@ -48,7 +48,7 @@ with a radius of ``100`` miles:
4848
.. code-block:: javascript
4949

5050
db.places.find( { loc: { $geoWithin: { $centerSphere: [ [ -74, 40.74 ] ,
51-
100 / 3959 ] } } } )
51+
100 / 3963.2 ] } } } )
5252

5353
You may also use the ``distanceMultiplier`` option to the
5454
:dbcommand:`geoNear` to convert radians in the :program:`mongod`
@@ -124,7 +124,7 @@ conversion. The following example uses ``distanceMultiplier`` in the
124124
db.runCommand( { geoNear: "places",
125125
near: [ -74, 40.74 ],
126126
spherical: true,
127-
distanceMultiplier: 3959
127+
distanceMultiplier: 3963.2
128128
} )
129129

130130
The output of the above operation would resemble the following:

source/tutorial/query-a-2d-index.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ Use the following syntax:
7777
} } )
7878

7979
The following example query returns all documents within a 10-mile
80-
radius of longitude ``88 W`` and latitude ``30 N``. The example converts
81-
distance to radians by dividing distance by the approximate radius of
82-
the earth, 3959 miles:
80+
radius of longitude ``88 W`` and latitude ``30 N``. The example
81+
converts distance to radians by dividing distance by the approximate
82+
equatorial radius of the earth, 3963.2 miles:
8383

8484
.. code-block:: javascript
8585

8686
db.<collection>.find( { loc : { $geoWithin :
8787
{ $centerSphere :
88-
[ [ 88 , 30 ] , 10 / 3959 ]
88+
[ [ 88 , 30 ] , 10 / 3963.2 ]
8989
} } } )
9090

9191
Proximity to a Point on a Flat Surface

source/tutorial/query-a-2dsphere-index.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,12 @@ Use the following syntax:
145145
The following example queries grid coordinates and returns all
146146
documents within a 10 mile radius of longitude ``88 W`` and latitude
147147
``30 N``. The example converts the distance, 10 miles, to radians by
148-
dividing by the approximate radius of the earth, 3959 miles:
148+
dividing by the approximate equatorial radius of the earth, 3963.2 miles:
149149

150150
.. code-block:: javascript
151151

152152
db.places.find( { loc :
153153
{ $geoWithin :
154154
{ $centerSphere :
155-
[ [ -88 , 30 ] , 10 / 3959 ]
155+
[ [ -88 , 30 ] , 10 / 3963.2 ]
156156
} } } )

0 commit comments

Comments
 (0)