Cloudant 地理空间点最近邻搜索的范围是多少
What is range of Cloudant geospatial point's nearest neighbour search
我正在使用 cloudant db 作为地理空间索引。 Cloudant 对点进行最近邻搜索。它有参数来限制结果的数量。但是最近邻居的范围是多少。我需要在 500 mts 内进行搜索。如何在 cloudant 中实现相同的效果。
您可以通过结合最近邻参数和几何参数来指定范围。例如,以下查询将查找指定 lat/long:
500 米范围内的所有文档
https://account.cloudant.com/yourDatabaseName
/_design/yourDesignDocName/
_geo/yourGeoIndexName
?lat=37.41511369
&lon=-122.2099019
&radius=500
&relation=contains
&nearest=true
更多信息:
https://docs.cloudant.com/geo.html
更新:务必添加&relation=contains
以确保结果仅包含半径范围内的位置。我已经更新了上面的例子。如果不包含关系,那么最近的邻居将 return "all GeoJSON documents in the database whose order is measured by the distance to the query point."
查看其他关系类型(即包含、交叉、重叠等)的文档
我正在使用 cloudant db 作为地理空间索引。 Cloudant 对点进行最近邻搜索。它有参数来限制结果的数量。但是最近邻居的范围是多少。我需要在 500 mts 内进行搜索。如何在 cloudant 中实现相同的效果。
您可以通过结合最近邻参数和几何参数来指定范围。例如,以下查询将查找指定 lat/long:
500 米范围内的所有文档https://account.cloudant.com/yourDatabaseName
/_design/yourDesignDocName/
_geo/yourGeoIndexName
?lat=37.41511369
&lon=-122.2099019
&radius=500
&relation=contains
&nearest=true
更多信息:
https://docs.cloudant.com/geo.html
更新:务必添加&relation=contains
以确保结果仅包含半径范围内的位置。我已经更新了上面的例子。如果不包含关系,那么最近的邻居将 return "all GeoJSON documents in the database whose order is measured by the distance to the query point."
查看其他关系类型(即包含、交叉、重叠等)的文档