Ruby lib to parse tcx and gpx files from GPS devices
Ruby Shell
Switch branches/tags
Nothing to show
Pull request Compare This branch is 15 commits ahead of rubyist:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
doc
lib
spec
test
.document
.gitignore
.rspec
.rvmrc
Gemfile
Gemfile.lock
LICENSE.txt
MIT-LICENSE
README.rdoc
Rakefile
VERSION
guppy.gemspec

README.rdoc

Guppy - Ruby library for handling tcx files

This library provides a set of classes for working with tcx and gpx dumps from GPS devices such as the Garmin Forerunner 305.

Example

parser = Guppy::Parser.new(File.open('spec/data/example.tcx'))

activities = parser.activities

activities.each do |activity|
  puts "Activity type: #{activity.activity_type}"
  puts "Started at: #{activity.started_at}"
  puts "Elapsed time: #{activity.elapsed_time}"
  puts "Distance: #{activity.distance}"
  puts "Average speed: #{activity.avg_speed}"
  puts "Maximum speed: #{activity.max_speed}"
  puts "Calories burned: #{activity.calories_burned}"
  puts "Average heart rate: #{activity.avg_heart_rate}"
  puts "Maximum heart rate: #{activity.max_heart_rate}"
  puts "Average cadence: #{activity.avg_cadence}"
  puts "Maximum cadence: #{activity.max_cadence}"
  puts ""

  activity.laps.each do |lap|
    puts "  Started at: #{lap.started_at}"
    puts "  Elapsed time: #{lap.elapsed_time}"
    puts "  Distance: #{lap.distance}"
    puts "  Average speed: #{lap.avg_speed}"
    puts "  Maximum speed: #{lap.max_speed}"
    puts "  Calories burned: #{lap.calories_burned}"
    puts "  Average heart rate: #{lap.avg_heart_rate}"
    puts "  Maximum heart rate: #{lap.max_heart_rate}"
    puts "  Average cadence: #{lap.avg_cadence}"
    puts "  Maximum cadence: #{lap.max_cadence}"
    puts "  Waypoints: #{lap.waypoints.size}"
    puts "    First waypoint lat: #{lap.waypoints.first.lat}"
    puts "    First waypoint long: #{lap.waypoints.first.long}"
    puts "    First waypoint altitude: #{lap.waypoints.first.altitude}"
    puts ""
  end
end

TODO

  • add support for gpx

  • add support for pwx

Other Stuff

Original Author

Scott Barron <scott at elitists dot net>

Remix

Michael Moen <michael at underpantsgnome dot com>

License

Copyright 2009 by Scott Barron. Released under an MIT-style license. See the MIT-LICENSE file included in the distribution.

GitHub

github.com/UnderpnatsGnome/guppy/tree/remix

Warranty

This software is provided “as is” and without any express or implied warranties, including, without limitation, the implied warranties of merchantibility and fitness for a particular purpose.