GeoCouch, a spatial index for CouchDB
Branch: master
Clone or download
timofey-barmin Erlang R16B03 -> 20.3: random:* -> rand:*
Change-Id: Ie4922ee277d1c50b044f0f09db5e8d7809b7b21b
Reviewed-by: Jeelan Basha Poola <>
Reviewed-by: Harsha H S
Tested-by: Harsha H S
Latest commit 92def13 Apr 30, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs MB-100: Fix typo Aug 11, 2014
gc-couchbase Erlang R16B03 -> 20.3: random:* -> rand:* May 2, 2018
gc-couchdb Erlang R16B03 -> 20.3: -compile(nowarn_export_all) May 1, 2018
vtree Erlang R16B03 -> 20.3: random:* -> rand:* May 2, 2018
wkb Fix syntax error in WKB app.src file Jun 10, 2016
CMakeLists.txt Use the discovered dialyzer Feb 20, 2015
COPYING MB-12007: Add proper license Aug 20, 2014
LICENSE MB-12007: Add proper license Aug 20, 2014
Makefile Make it compile properly Jun 10, 2016 Update README Jun 27, 2016
rebar_couchbase.config CBD-697: Prepare build system for Apache CouchDB Aug 11, 2014
rebar_couchdb.config Compile WKB module Jun 10, 2016

Welcome to the world of GeoCouch

GeoCouch is a spatial extension for Couchbase and Apache CouchDB.

For Couchbase

For compiling Couchbase (it includes GeoCouch), please see

For Apache CouchDB

This version of GeoCouch needs at least Apache CouchDB 1.3.x.

Checkout the code

First checkout the source code for Apache CouchDB into a directory that will be referred to as <path-to-couchdb-source>.

Then checkout the GeoCouch source:

git clone

There's a new directory called geocouch created. From now on this directory will be referred to as <path-to-geocouch-source>.

Build instructions

Make sure you have built Apache CouchDB from source including make dev. So go to your <path-to-couchdb-source> and run:

make dev

After that you can compile GeoCouch from within the GeoCouch directory:

COUCH_SRC=<path-to-couchdb-source>/src/couchdb make couchdb

Now copy the configuration file into your Apache CouchDB directory:

cp gc-couchdb/etc/couchdb/default.d/geocouch.ini <path-to-couchdb-source>/etc/couchdb/default.d/

Running Apache CouchDB

Apache CouchDB needs the compiled geocouch in the include path. You can either copy gc-couchdb and vtree into <path-to-couchdb-source>/src/ or set the ERL_LIBS environment variable to the GeoCouch root directory.

cd <path-to-couchdb-source>
ERL_LIBS="<path-to-geocouch-source>" ./utils/run

Running tests

After you've followed the build instructions you can run the tests with

COUCH_SRC=<path-to-couchdb-source>/src/couchdb make couchdb-check

In order to run the JavaScript based tests, you need to start Apache CouchDB first:

cd <path-to-couchdb-source>
ERL_LIBS="<path-to-geocouch-source>" ./utils/run

The tests can either be run from the command line or the browser.

From command line

From the command line the easiest way is to use the supplied runner script. From within the <path-to-geocouch-source>:

cd gc-couchdb
./utils/ <path-to-couchdb-source>/test/javascript/run ./share/www/script/test

From browser

To run it from the browser first copy the JavaScript tests into the same directory as the other Apache CouchDB tests:

cp <path-to-geocouch-source>/gc-couchdb/share/www/script/test/* <path-to-couchdb-source>/share/www/script/test/

Then add the tests to <path-to-couchdb-source>/share/www/script/couch_tests.js


More information

For more information and samples please see the README in the gc-couchdb subdirectory.


GeoCouch is licensed under the Apache License 2.0.