A convenient web interface to the GPS track data gathered by the My Tracks application on the Android phone.
- Easily load ride data from Google Fusion Tables into a user’s account
- Display maps of all the user’s rides like this that can be easily browsed and searched
- Allow user to attach public/private notes to each ride
- Support for Metric and English units
The TODO list
- User feedback during ride import process
- Robust search/filtering capability (currently can only search by user ID)
- Show multiple routes on a single map
- More interesting and customizable aggregate statistics on rides
- Long term: provide a distribution of the elapsed time between two user-selected waypoints (across all the rides that went through those waypoints).
AJAX for ride import
- Click 'Import Rides'
- Request for list of ride ids that aren't in DB
- "Status: getting new rides"
- Spawn series of requests (batches of 5?) to import rides
- "Status: importing rides"
- Append new ride descriptions to page
- My ride spreadsheet
- My fusion tables as well their Google Docs counterparts
- The application’s database
- User - has many Rides
- Ride - belongs to a User
Displaying the maps
- Find centerpoint and bounding boxes for map by parsing the ride data and using the geo_data gem.
<div>element where the map will be inserted.
Getting up and running
- bundle install
- bundle exec rake db:migrate
- bundle exec rake db:test:prepare
- bundle exec thin start (for development use thin instead of webrick, works with the google auth)
- edit /etc/hosts file
- Postgresql is the DB, some helpful commands:
- to install (on OS X): brew install postgresql
- on Ubuntu, to create the databases: sudo -u postgres createdb db/test sudo -u postgres createdb db/development
- to get status of server: pg_ctl status -D /usr/local/var/postgres/
- to list available databases: psql -l
- to process the background jobs that fetch Temperature data from Weather Underground: heroku run rake jobs:work Click on "Update Rides" in app (this puts rides without Temperature data on the queue)
- Check out the startft.rb script for using GData::FusionTables interface
- set client secret in config/initializers from https://code.google.com/apis/console/
http://bostonrb.org/presentations/write-code-faster-expert-level-vim Good talk on using VI for Rails
http://rubular.com/ The nifty reg exp playground
http://code.google.com/apis/accounts/docs/OpenID.html Uses the Hybrid strategy (OpenID authentication of user + OAuth authorization for access to Fusion Tables)
http://railscasts.com/episodes/236-omniauth-part-2 At 11:30 see how to override devise password required.
A working example of using omniauth with Google as a provider.
- First, I Googled ‘providers in omniauth’
- using pry (cd OmniAuth::Strategies::Goo > tab complete to see all Google strategies)
- bundle open omniauth to look at the source code
- from a comment in the gems-open-id*google_hybrid file found this example, made by the person who wrote the provider