This geolocation app demonstrates the use of PostGIS.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
bin
config
db
lib
log
public
spec
vendor/assets
.gitignore
.rspec
Gemfile
Gemfile.lock
README.rdoc
Rakefile
config.ru

README.rdoc

Geolocation App

This geolocation app demonstrates the use of PostGIS.

PostGIS is a spatial database extender for PostgreSQL object-relational database. It adds support for geographic objects allowing location queries to be run in SQL.

The app accepts file uploads, stores the records in a database, and then displays a list of locations ordered by distance from a given point (lat/lon).

Development

Rules of the road

This project attempts to follow Sandi Metz's Rules.

A [description of the rules here](robots.thoughtbot.com/post/50655960596/sandi-metz-rules-for-developers).

Dependencies

$ Rails 4.0.0
$ Ruby 2.1.1
$ PostgreSQL 9.2
$ PostGIS

Setup

  1. Install Homebrew packages.

    $ brew install postgres --no-python
  2. Follow post-install instructions for loading launch agents.

    $ brew info postgres
  3. To enable PostGIS once connected to your PostgreSQL 9.2 database run:

    $ CREATE EXTENSION postgis;
  4. Create a application.yml file under /config and add your ENV variables. Mine looks like this:

    $ LOCAL_PG_USER: "carlisia"
    $ LOCAL_HOST: "localhost"
    
    $ GEO_SUPERUSER: "geo_rails_test_creator"
    $ GEO_SUPER_PWD: "geo_pwd"
    
    $ GEO_USER: "geo_rails_test_creator"
    $ GEO_PWD: "geo_pwd"
  5. Install RVM.

    $ \curl -L https://get.rvm.io | bash -s stable --ruby
  6. Get the code.

    $ git clone git@github.com:carlisia/geolocationapp.git
  7. Verify that the app is up and running.

    $ open http://localhost:5000

To-do list

$ Better error handling and reporting
$ Better test coverage
$ Hookup to Code Climate
$ Document the API
# Better document environment configuration
# Document deployment