diff options
author | Max Hirschhorn <max.hirschhorn@mongodb.com> | 2016-06-10 13:51:27 -0400 |
---|---|---|
committer | Max Hirschhorn <max.hirschhorn@mongodb.com> | 2016-06-10 13:51:27 -0400 |
commit | 98009524ca86f9e63b3865d55638630e3985d34e (patch) | |
tree | 1db594170dd2fce14538664560b3c860a8a3c679 | |
parent | 52791d95b1cb4ae58c39ad04681d5d18d6bb150c (diff) | |
download | mongo-98009524ca86f9e63b3865d55638630e3985d34e.tar.gz |
SERVER-24441 Avoid creating points near the poles in geo_full.js.
(cherry picked from commit 3ee21ae53b1aedf0820e627f37cf502871e7a0d2)
-rw-r--r-- | jstests/noPassthrough/geo_full.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/jstests/noPassthrough/geo_full.js b/jstests/noPassthrough/geo_full.js index 60d18f96c68..897fc20e4d1 100644 --- a/jstests/noPassthrough/geo_full.js +++ b/jstests/noPassthrough/geo_full.js @@ -143,8 +143,11 @@ function errorMarginForPoint(env) { function pointIsOK(startPoint, radius, env) { var error = errorMarginForPoint(env); var distDegrees = rad2deg(radius) + error; - // Cap should not include the South/North Pole. - if ((startPoint[1] + distDegrees > 90) || (startPoint[1] - distDegrees < -90)) { + // TODO SERVER-24440: Points close to the north and south poles may fail to be returned by + // $nearSphere queries answered using a "2d" index. We have empirically found that points with + // latitudes between 89 and 90 degrees are potentially affected by this issue, so we + // additionally reject any coordinates with a latitude that falls within that range. + if ((startPoint[1] + distDegrees > 89) || (startPoint[1] - distDegrees < -89)) { return false; } var xscandist = computexscandist(startPoint[1], distDegrees); |