Created
July 1, 2011 11:37
-
-
Save ianAndrewClark/1058361 to your computer and use it in GitHub Desktop.
3 point polygon with bounded box query
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"from": 0, | |
"size": 100, | |
"facets": { | |
"outcodes": { | |
"terms": { | |
"field": "postalsector", | |
"order": "count", | |
"size": 5 | |
} | |
} | |
}, | |
"query": { | |
"filtered": { | |
"query": { | |
"match_all": {} | |
}, | |
"filter": { | |
"and": [ | |
{ | |
"geo_bounding_box": { | |
"place.location": { | |
"top_left": { | |
"lat": 55.632287429523885, | |
"lon": -1.6498882438124358 | |
}, | |
"bottom_right": { | |
"lat": 55.16292076396345, | |
"lon": -1.555221869032622 | |
} | |
} | |
} | |
}, | |
{ | |
"or": [ | |
{ | |
"geo_polygon": { | |
"place.location": { | |
"points": [ | |
{ | |
"lat": 55.16292076396345, | |
"lon": -1.5570090587125622 | |
}, | |
{ | |
"lat": 55.163137501681156, | |
"lon": -1.555611785762679 | |
}, | |
{ | |
"lat": 55.163357902190725, | |
"lon": -1.555221869032622 | |
}, | |
{ | |
"lat": 55.16385209929337, | |
"lon": -1.5569212410631552 | |
}, | |
{ | |
"lat": 55.16398968551015, | |
"lon": -1.558159627903099 | |
}, | |
{ | |
"lat": 55.16408513679775, | |
"lon": -1.560018442781531 | |
}, | |
{ | |
"lat": 55.16386723330527, | |
"lon": -1.5611057604225753 | |
}, | |
{ | |
"lat": 55.163195643465485, | |
"lon": -1.5594082920891694 | |
}, | |
{ | |
"lat": 55.16292582353815, | |
"lon": -1.558403868130423 | |
}, | |
{ | |
"lat": 55.16292076396345, | |
"lon": -1.5570090587125622 | |
} | |
] | |
} | |
} | |
}, | |
{ | |
"geo_polygon": { | |
"place.location": { | |
"points": [ | |
{ | |
"lat": 55.62988530080882, | |
"lon": -1.624051493485553 | |
}, | |
{ | |
"lat": 55.63041689609046, | |
"lon": -1.6238111698826672 | |
}, | |
{ | |
"lat": 55.63108397191733, | |
"lon": -1.6243536718008966 | |
}, | |
{ | |
"lat": 55.6317508055574, | |
"lon": -1.6248177802549206 | |
}, | |
{ | |
"lat": 55.63215148004208, | |
"lon": -1.6252844442845185 | |
}, | |
{ | |
"lat": 55.632287429523885, | |
"lon": -1.6262241398961268 | |
}, | |
{ | |
"lat": 55.63135444234749, | |
"lon": -1.6257625351994207 | |
}, | |
{ | |
"lat": 55.630289571993046, | |
"lon": -1.6256942720013232 | |
}, | |
{ | |
"lat": 55.62984334150122, | |
"lon": -1.6248360037297411 | |
}, | |
{ | |
"lat": 55.62988530080882, | |
"lon": -1.624051493485553 | |
} | |
] | |
} | |
} | |
}, | |
{ | |
"geo_polygon": { | |
"place.location": { | |
"points": [ | |
{ | |
"lat": 55.61584373495726, | |
"lon": -1.6459763142776096 | |
}, | |
{ | |
"lat": 55.61642131771883, | |
"lon": -1.6462846440177488 | |
}, | |
{ | |
"lat": 55.616779581452214, | |
"lon": -1.6474571919902903 | |
}, | |
{ | |
"lat": 55.617225879288114, | |
"lon": -1.6483938135703402 | |
}, | |
{ | |
"lat": 55.617273156688285, | |
"lon": -1.6494124054940043 | |
}, | |
{ | |
"lat": 55.61665346036219, | |
"lon": -1.6498882438124358 | |
}, | |
{ | |
"lat": 55.61598537467741, | |
"lon": -1.6489535978958554 | |
}, | |
{ | |
"lat": 55.61567193623091, | |
"lon": -1.6479374247486962 | |
}, | |
{ | |
"lat": 55.61553479891577, | |
"lon": -1.6465277723821705 | |
}, | |
{ | |
"lat": 55.61584373495726, | |
"lon": -1.6459763142776096 | |
} | |
] | |
} | |
} | |
} | |
] | |
} | |
] | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment