There seem to be a typo in the README file.

Change-Id: Ib13b09650760429bce6b169443d2000d9db29a85
Reviewed-on: http://review.couchbase.org/8758
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Tested-by: Volker Mische <volker.mische@gmail.com>
Wrong path to the couch_tests.js file

Change-Id: I8dcbafe704bcb34f2e1890b1df8c4a60ff877742
Reviewed-on: http://review.couchbase.org/8759
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Tested-by: Volker Mische <volker.mische@gmail.com>
Update README to reflect current output.

In previous versions the response didn't contain the original
geometry, now it does.

Change-Id: I386d666aa708c74b3d0794affda1bd0cc25d3569
Reviewed-on: http://review.couchbase.org/9779
Tested-by: Dale Harvey <daleharvey@arandomurl.com>
Reviewed-by: Dale Harvey <daleharvey@arandomurl.com>
Make GeoCouch work again.

The couch_tasks module was changed an rendered GeoCouch
unusable. This commit fixes the problem.

Change-Id: I7c0a90e1595ffecf0afd68e4f917fd4fdacae40b
Reviewed-on: http://review.couchbase.org/9780
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Tested-by: Dale Harvey <daleharvey@arandomurl.com>
Reviewed-by: Dale Harvey <daleharvey@arandomurl.com>
Compacting an empy index creates errors.

When you compacted an index that didn't contain any data,
GeoCouch spit out a huge stack trace. This commit fixes
the problem.

Change-Id: I201683ea135bf00841734595024e8c7e436292f0
Reviewed-on: http://review.couchbase.org/9781
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Tested-by: Dale Harvey <daleharvey@arandomurl.com>
Reviewed-by: Dale Harvey <daleharvey@arandomurl.com>
Make timing calculations simpler.

No longer use a custom function for timing.

Change-Id: Iec46b723de9a0a59f5f4d5ddd7a2c7a0786dd71a
Reviewed-on: http://review.couchbase.org/10091
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Tested-by: Volker Mische <volker.mische@gmail.com>
Include information about branches.

There was some confusion about the branches of GeoCouch,
this commit should clearify things.

Change-Id: I28ad6a6d52d406885ba2cd4241328d630985a4ae
Reviewed-on: http://review.couchbase.org/11048
Reviewed-by: Jan Lehnardt <jan@couchbase.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Tested-by: Volker Mische <volker.mische@gmail.com>
Make tests more robust.

Don't depend on the on-disk format for the tests,
better test if the data has the correct structure.

Change-Id: I114f6ef423be8196367aec547a7452a0f493e674
Reviewed-on: http://review.couchbase.org/10950
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Move GeoCouch config file.

The config file of GeoCouch belongs to default.d, not
local.d.

Change-Id: I6e760c575bef971df8eeb8ea36bdbc9a395632dd
Reviewed-on: http://review.couchbase.org/9139
Reviewed-by: Jan Lehnardt <jan@couchbase.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reword error message.

Change not_found error from missing_named_view to
missing_named_index.

Change-Id: I402b769e31337e1f05de1f4b16a013846cd2d223
Reviewed-on: http://review.couchbase.org/10842
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Update db group handling.

Update the database group handling according to the
changes in the group handling of the views.

This commit prepares for the spatial index merging.

Change-Id: If0f18bd5e08b5813b0ffcb21fb51e3c05c3fe39f
Reviewed-on: http://review.couchbase.org/10843
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Spatial index merging.

Based on the view merging refactoring it is now also
possible to merge spatial indexes. The API is similar
to the view merger one.

For example POST to http://localhost:5984/_spatial_merge
{
  "spatial": {
    "localdb1": ["ddocname/spatialname", ...],
    "http://server2/dbname": ["ddoc/spatial"],
    "http://server2/_spatial_merge": {
      "spatial": {
        "localdb3": "spatialname", // local to server2
        "localdb4": "spatialname"  // local to server2
      }
    }
  }
}

To call it internally use
couch_index_merger:query_index(
    couch_spatial_merger, Req, MergeParams)

Change-Id: I3f207aba88d4f65ed9f74fd2ca3dfbcf1af635f5
Reviewed-on: http://review.couchbase.org/10844
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
start_doc_map/3 is exported by couch_query_servers.

start_doc_map/3 is exported, so we don't need to have
it in geocouch_duplicates any longer.

Change-Id: Ia9f4e005258f4ac045cd6ef451146ca5d6f723df
Reviewed-on: http://review.couchbase.org/10845
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
don't needlessly repeate bboxes_not_disjoint computation

This computation is purely functional and does not depend on current
loop item (child entry position), thus can be moved out of loop.

Change-Id: I430b15757097ea2b53ef335e15ab30b3454e9d5e
Reviewed-on: http://review.couchbase.org/11413
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Volker Mische <volker.mische@gmail.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>
remove superfluous vtree:lookup/5 case

Both is_list and not is_list case when last argument (plane bounds) is
nil do same thing, thus we can have only one case.

Change-Id: I531102f5cf177c794c2c5a76184da5c4cf123981
Reviewed-on: http://review.couchbase.org/11414
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Volker Mische <volker.mische@gmail.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Make _spatial/_list tests more robust

GeoCouch doesn't guarantee any ordering of the results,
hence the tests shouldn't depend on any ordering.

Change-Id: Ibbfffbcd41e00f707fcaafb272a8a7409626b297
Reviewed-on: http://review.couchbase.org/10949
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Removal of CouchDB revision tree support for efficiency

XDCR is broken. Otherwise ready for testing.

Change-Id: Ibfb5dd870b185b2992f2728ece7677b49c49aaca
Reviewed-on: http://review.couchbase.org/11221
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Reviewed-by: Damien Katz <damien@couchbase.com>
Tested-by: Damien Katz <damien@couchbase.com>
Adapt spatial merger to recent couch_index_merger changes

Change-Id: I7a7b6a28122f0a1f33b3eb899bc364a88b6f8e2b
Reviewed-on: http://review.couchbase.org/11994
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
Tested-by: Volker Mische <volker.mische@gmail.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>
GeoCouch now works with Apache CouchDB 1.2.x

Change-Id: Ib973964c865518621abd2366be2f047c74a4e970
Reviewed-on: http://review.couchbase.org/12111
Tested-by: Volker Mische <volker.mische@gmail.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Add skip and limit to GeoCouch

GeoCouch now supports the "skip" and "limit" parameter
for spatial indexes as well as for spatial _list
functions.

Change-Id: I596b634170f13a453541f47abe7fe7f2cf60492c
Reviewed-on: http://review.couchbase.org/11166
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>