根据这个
http://docs.mongodb.org/manual/reference/operator/aggregation/geoNear/
聚合框架可以返回点与坐标的距离
有没有办法可以输入并获得两点之间的距离或点到多边形?或者在我的C#代码中执行此操作会更有效吗?
实施例: 我创建了以下地址
"LocationName" : "Pot of Gold",
"Address" : {
"Street" : "13305 104TH ST",
"City" : "PLEASANT PRAIRIE",
"StateProvince" : "WI",
"PostCode" : "",
"County" : "us",
"Country" : "United States of America",
"CountryCode" : "Kenosha County",
"Gps" : {
"bbox" : [-180.0, -90.0, 180.0, 90.0],
"geometry" : {
"type" : "Point",
"coordinates" : [-87.917057, 42.524231]
},
"type" : "Feature"
}
我们获得了gps位置-86.9439485,42.58495849
我想使用gps位置,并远远地发现该位置来自Pot of gold位置。