Ruby gem for parsing and extracting common data structures from geo route file formats like GPX.
Used in the Bunch Rides web app.
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.