mongodb地理空间计算逻辑

"1/地球半径"是怎么得出的

参考文档如下:

http://janmatuschek.de/LatitudeLongitudeBoundingCoordinates

http://en.wikipedia.org/wiki/Angular_diameter

 

nearSphere的最大距离和最小距离的单位是弧度。官方文档介绍如下:http://docs.mongodb.org/manual/reference/operator/query/nearSphere/

{
  $nearSphere: [ <x>, <y> ],
  $minDistance: <distance in radians>,
  $maxDistance: <distance in radians>
}

http://docs.mongodb.org/manual/tutorial/calculate-distances-using-spherical-geometry-with-2d-geospatial-indexes/

http://docs.mongodb.org/manual/reference/operator/query/centerSphere/#op._S_centerSphere
centerShpere距离的单位是米。

 

Radians  degrees 分别表示弧度和度的概念

posted @ 2014-10-30 21:45  唾手可得的树  阅读(540)  评论(0编辑  收藏  举报