Project

broutes

0.01
No commit activity in last 3 years
No release in over 3 years
Utilities for parsing and creating geo route files
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 0.0.2
~> 1.5
 Project Readme

Broutes

Ruby gem for parsing and extracting common data structures from geo route file formats like GPX.

Used in the Bunch Rides web app.

endorse

Supported Formats

Usage

Add this to your Gemfile

  gem 'broutes'

Then open a file and pass it in to the from_file method along with the format.

file = File.open('path to route file')
route = Broutes.from_file(file, :gpx_track)

The format string can either be a symbol, mimetype or filename from which the extension is used.

Format Symbol Mime Type File Extension
GPX Track :gpx_track application/gpx+xml .gpx
Garmin TCX :tcx application/vnd.garmin.tcx+xml .tcx
ANT+ FIT :fit application/vnd.ant.fit .fit

The result route file will have a total distance, ascent and descent info as well as start and end points. Each point will also have it's location, elevation and distance along the route.

If the format used supports laps (TCX formats), the route will also have each lap. Each lap will have it's start time, total time, distance covered, calories burned, the average and maximum speed, and the average and maximum heart rate.