Querying All Data
This query retrieves all data based on the GeoJSON polygons example.
Description
The results are either viewable in the web console or are returned when the spatial view is queried without any additional parameters. In both cases, all documents are retrieved.
There isn’t a specific ordering, expect it to be arbitrary. Once the view file is updated, the order might change. |
Syntax
Curl syntax:
curl http://[localhost]:8092/[bucket-name]/_design/[design-doc]/_spatial/[spatial-name]
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
Response
Returns all of the data:
{"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]]]}}, {"id": "flemish_diamond", "key":[[3.55,4.84],[50.73,51.3],[2947,2947]], "value":"Flemish Diamond", "geometry": {"type":"Polygon","coordinates":[[[3.55,51.08],[4.36,50.73],[4.84,50.85],[4.45,51.3],[3.55,51.08]]]}}}]}
The individual rows contain the total_rows (which is always 0), document ID, the key that got stored, the emitted value, and geometry. The key gets automatically calculated and is the enclosing bounding box of the emitted geometry. When refining the query, the key is always used for comparison.