Querying on Non-intersect
This query retrieves data based on the GeoJSON polygon example and on bounding box parameters that are within the query range.
Description
Queries only filter on a bounding box level. This means that even if the actual geometry doesn’t intersect the query ranges but its bounding box does, it is still included in the result.
Syntax
Curl syntax:
curl http://[localhost]:8092/[bucket-name]/_design/[design-doc]/_spatial/[spatial-name]?start_range=[]&end_range=[]
Example
The following example is based on the GeoJSON polygon data and the associated spatial view function.
Curl example:
curl http://10.5.2.54:8092/default/_design/areas/_spatial/locAndArea?start_range=[-84,29,null]&end_range=[-72,37,null]
Response
The response shows that the ranges don’t intersect the polygon of the Bermuda Triangle, but its enclosing bounding box does which can be found in its key.
{"total_rows":0,"rows":[ {"id": "bermuda_triangle", "key": [[-80.19,-64.73],[18.43,32.31],[1150180,1150180]], "value": "Bermuda Triangle", "geometry": {"type":"Polygon","coordinates":[[[-64.73,32.31],[-80.19,25.76],[-66.09,18.43],[-64.73,32.31]]]}}, {"id": "research_triangle", "key": [[-79.04000000000001,-78.67],[35.78,36],[252,252]], "value": "Research Triangle", "geometry": {"type":"Polygon","coordinates":[[[-78.93000000000001,36],[-78.67,35.78],[-79.04000000000001,35.9],[-78.93000000000001,36]]]}}]}