/angel

ambient sensor network for communities

Primary LanguageRuby

===============
HOW TO RUN
===============

I use the swiftriver daemons approach from http://wiki.github.com/ajturner/swiftriver/installation

You can kick off the polling daemons in lib/daemons by running:

    RAILS_ENV=development
    script/daemons start

OR

    RAILS_ENV=development
    ruby lib/daemons/poll_twitter_ctl start

===============
HOW TO INSTALL
===============

Also see the /about page on the site for other details that may be relevant.

1) You will need postgres and postgis.  These are used for spatial queries and for full text search as well as ordinary database storage. It is unlikely you'll get this running on mysql easily.

You'll need the world borders in the database - see this url:

http://blog.newsplore.com/2009/02/22/spincloud-labs-political-boundaries-overlay-in-google-maps-part-1/comment-page-1

There are some gotchas - shp2pgsql requires UTf8 support enabled.  So if you are making it from the freebsd ports for example you need to do a 'make config' to enable that.  You may want to also make sure that postgres is built with GEOS - not sure if this is needdd however.

Also the utf8 encoding is bizarre.  You may want to try encode as latin1.

Basically Make a spatially enabled database like so:

   createuser -p  # name angel password angel
   createdb -O angel angel
   createlang plpgsql angel
   psql -d angel -f /usr/local/share/postgis/lwpostgis.sql
   psql -d angel -f /usr/local/share/postgis/spatial_ref_sys.sql

   wget http://mappinghacks.com/data/TM_WORLD_BORDERS-0.2.zip
   unzip TM_WORLD_BORDERS-0.2.zip
   shp2pgsql -E LATIN1 -d TM_WORLD_BORDERS-0.2.shp world_boundaries angel > wb_dump.sql
   psql angel < wb_dump.sql
   # you will want to do postgres grants on these tables to the angel owner

2) There are a pile of gems that are required:

   gem install GeoRuby # used by: script/plugin install git://github.com/fragility/spatial_adapter.git
   gem install sanitize
   gem install tsearch2
   gem install json-pure
   gem install ...

3) There is a settings.yml file that has pile of third party requirements such as keys from metacarta.

4) There is some test data to seed the database - you can load it like this:

  rake db:migrate:redo
  rake db:seed

5) I like to use passenger phusion - it is optiona.

6) type "script/server start" to run the application.  it will appear on port 80 and you can use a web browser to see it.

7) Use compass to rebuild the css