MongoDB geo distance/radius to useful units

前端 未结 3 767
感情败类
感情败类 2021-02-10 00:41

I\'m using MongoDB geospatial queries -- $near, geoNear, etc. -- and I\'d like to know how to turn the dis result of the geoNear

3条回答
  •  甜味超标
    2021-02-10 01:48

    Note if you're using Mongodb version 2.6.0 there is a bug which always enables the new behavior for spherical coordinate systems to return distance in meters (based on WGS84 coordinates).

    The documentation states that giving the $near parameter in legacy coordinates rather than GeoJSON should still return radians. This has been fixed in newer versions.

    The bug report: Bug #13540

提交回复
热议问题