Thursday 24 October 2013

Prerequisites

This project requires some prerequisites which i should fulfill in other to continue. The first of these are

Apache CouchDB and GeoCouch.

Apache CouchDB

CouchDB is an opensource document-oriented database that started in 2005 and was adopted by Apache in 2013. This is a NoSQL database meaning it is not based on traditional relational database models for simplicity, horizontal scaling and contol. JSON is used to store data and queries are performed using javascript.

GeoCouch

This is a spacial extension for Apache CouchDB.

================================================================================================================================================


The first step i took towards installing couchdb/geocouch was to use the source provided here :

https://github.com/iriscouch/build-couchdb

When i try to build by running  "sudo rake"
I get a missing package error : missing package : libxslt1-dev
But i can vouch that this package has been installed.
So using that package, i couldn't go any further.


I reverted changes and the next step was :

The latest version of apachecouchdb is 1.4, which can be automatically installed from aptitude.However geocouch is version 1.3 thus not guaranteed compability.After installing apachecouchdb, i had to install geocouch using the source of apachecouchdb as the manual(https://github.com/couchbase/geocouch/tree/couchdb1.3.x) says but i had this error while "making" geocouch.

Uncaught error in rebar_core: {'EXIT',{{badmatch,{error,badfile}},
                                       [{rebar_core,select_modules,3},
                                        {rebar_core,acc_modules,4},
                                        {rebar_core,process_dir,4},
                                        {rebar_core,process_commands,2},
                                        {rebar,main,1},
                                        {escript,run,2},
                                        {escript,start,1},
                                        {init,start_it,1}]}}
make: *** [compile] Error 1
.....................................................................

So i revert to original and tried to install apachecouchdb1.3 with geocouch1.3. I still encountered the recore_core error, but i somehow got passed that by reinstalling rebar. But after trying to "make" i had this new error which i was not able to comprehend at first.

can't find include file "couch_db.hrl"

So upon searching, i found a fix for it but however this fix (
https://aur.archlinux.org/packages/geocouch/) could not work for the apachecouchdb1.3 version. So i went back to version 1.4, tried and it was succesful.


Further more, after trying to configure geocouch with couchdb as in

https://github.com/couchbase/geocouch

Everything went ok, until the moment when i had to test the geocouch.

This statement : curl -X GET 'http://localhost:5984/places/_design/main/_spatial/points?bbox=0,0,180,90'

failed !

With this error : {error":"not_found". "reason":"missing handler: _spatial"}

So upon further digging, i found a post (http://www.blmak.com/blog/?p=414)  which said that the README instructions were misleading, so after following the method which was described there, i succeeded in running the command without any errors.

So for an update : Couchdb and Geocouch are running ok !

The next step is to install erica and Libremap.