I am running Couchbase Single Server 1.2 and attempting to use the Geospatial indexing features (GeoCouch).
I have followed all the instructions in the readme. My design document is structured as follows:
{ _id: "_design/main",
_rev: "24-4bfa80ed0a93b7bff3008a64a4b0ff89",
language: "javascript",
spatial: {
points: "function(doc) {
if (doc.loc) {
emit({ \"type\": \"Point\", \"coordinates\": doc.loc }, [doc._id, doc.loc]);
}
};"
}
}
My couchdb database is called places. When places is empty, if I call the bounding box query,
http://localhost:5984/places/_design/main/_spatial/points?bbox=0,0,180,90
I get the following:
{
rows: [ ]
}
It looks good. It means the query url is working correctly.
But when I add some data to the places database, such as the following:
{
_id: "berlin",
_rev: "1-204646602c35d80238ad345ca8d3fcef",
loc:
[
-122.270833,
37.804444
]
}
and call the bounding box query again, I get the following error:
{
error: "{{badmatch,{ok,8497}}, [{vtree_bulk,omt_write_tree,4}, {vtree_bulk,omt_write_tree,2}, {vtree_bulk,bulk_load,4}, {vtree,add_remove,5}, {couch_spatial_updater,'-write_changes/4-fun-2-',5}, {lists,zipwith,3}, {couch_spatial_updater,write_changes,4}, {couch_spatial_updater,update,2}]}",
reason: "{gen_server,call,[<0.22235.0>,{request_group,41},infinity]}"
}
I am running Couchbase 1.2 on a Windows 7 (32-bit) development machine.
Does anyone have any idea about this error?
Thanks.
I’ve tried it on Linux with Couchbase Single Server 1.2 and couldn’t reproduce it. Could you please try the latest deveoper preview of Couchbase Single Server 2.0. You can get it here.