给定lat/lng,找出lat/lng所在的每个圆圈
我有一个geoshape文档列表,如下所示:给定lat/lng,找出lat/lng所在的每个圆圈,
Warning: implode(): Invalid arguments passed in /data/phpspider/zhask/webroot/tpl/detail.html on line 45
,,我有一个geoshape文档列表,如下所示: { "location" : { "type" : "circle", "coordinates" : [-45.0, 45.0], "radius" : "8000m" } } 给定一个lat/lng,我想查找该lat/lng所在的所有文档。您需要使用一个geo\u形状查询,如下所示: { "query": { "bool": { "filter": {
{
"location" : {
"type" : "circle",
"coordinates" : [-45.0, 45.0],
"radius" : "8000m"
}
}
给定一个lat/lng,我想查找该lat/lng所在的所有文档。您需要使用一个
geo\u形状
查询,如下所示:
{
"query": {
"bool": {
"filter": {
"geo_shape": {
"location": {
"shape": {
"type": "point",
"coordinates": [ -77.03653, 38.897676 ] <-- lon/lat to search
},
"relation": "contains" <-- use the contains relationship
}
}
}
}
}
}
{
“查询”:{
“布尔”:{
“过滤器”:{
“geo_形状”:{
“地点”:{
“形状”:{
“类型”:“点”,
“坐标”:[-77.03653,38.897676]您需要使用geo_形状
查询,如下所示:
{
"query": {
"bool": {
"filter": {
"geo_shape": {
"location": {
"shape": {
"type": "point",
"coordinates": [ -77.03653, 38.897676 ] <-- lon/lat to search
},
"relation": "contains" <-- use the contains relationship
}
}
}
}
}
}
{
“查询”:{
“布尔”:{
“过滤器”:{
“geo_形状”:{
“地点”:{
“形状”:{
“类型”:“点”,
“坐标”:[-77.03653,38.897676]您可以尝试一下吗?只是尝试一下。您可以删除“关系”:“包含”
,因为它默认为相交
。对于点查询,默认值有效。明白了,很高兴它有帮助!您可以尝试一下吗?只是尝试一下。您可以删除“关系”:“包含”
,因为它默认为相交
。对于点查询,默认值有效。明白了,很高兴它有帮助!