I just tried to install GeoCouch (CouchDB with Geo features) on my Mac and ran into some problems so hopefully this is gonna help you my friend Mac-NoSQL-CouchDB-lover.
First of all I highly recommend you install Homebrew (Xcode required). Homebrew (“brew” on the command line) is the easiest package manager for Macs. To get more information on how to install Homebrew, please click here. If you are on a Linux box you might want to check out this script written by the awesome people from WebFaction.
If you are going to import shape files and load real
geographic data into GeoCouch, you will need shp2couch from Max Ogden. I don’t know who he is, I don’t know how he’s like, I never talk to him but I am a huge fan. He has some great projects out there.
gem install shp2couch
If it fails you need to:
brew install gdal
That also failed for me so I downloaded the dmg (70mb) and installed it. You need to add ogr2ogr to your $PATH, by adding the following to your $HOME/.bashrc: “export PATH=/Library/Frameworks/GDAL.framework/Programs:$PATH”.
Thank you bx2 @ Stackoverflow! On a side note, everyone seems to use curl nowadays, I can’t never remember the syntax that well, wget is home for me, probably because I miss Linux, thank goodness Homebrew is around. Now try installing gdal and shp2couch again. Assuming that worked let’s clone GeoCouch’s repository from Github.
git clone http://github.com/vmx/couchdb.git geocouch cd geocouch ./boostrap ./configure (it this fails you need to: "brew install icu4c; brew link icu4c" and try again) make dev ./utils/run
Do not install couchdb from HomeBrew because it won’t have all the geo goodies. The official documentation on how to install GeoCouch is here.
You probabily want to install GISLook, so you can see your shape files easily, that’s very easy, standard Mac installation. Now you need some data to work with, a great location for lots of free geodata is Data.gov.
It’s so easy to create a new database on CouchDB, from your command-line (assuming it’s running locally at the default port):
curl -X PUT http://localhost:5984/DBNAME
You can also upload your shape file, again from the command-line:
shp2geocouch YOURDATA.shp http://localhost:5984/YOURDATA
Now you want to do a geosearch:
git clone https://github.com/vmx/geocouch-utils
couchapp push http://localhost:5984/YOURDB
Then in your browser type: http://localhost:5982/YOURDB/design/vmchx/spatial/points?bbox=-180,-90,180,90.
Check out a live example from a database I just loaded.
Have Fun! I would love to hear about your success story.