gpx_utils

Import track file

g = GpxUtils::TrackImporter.new
g.add_file('track_file.gpx')
g.coords
 => [{:lat=>52.4606258981, :lon=>16.9213317242, :time=>2012-03-24 18:48:22 +0100, :alt=>83.77}, ...]

Import waypoints file

g = GpxUtils::WaypointsImporter.new
g.add_file('waypoints.gpx')
g.pois
 => [{:lat=>49.461531, :lon=>21.160355, :time=>2012-04-30 09:10:48 +0200, :alt=>492.629486, :name=>"PKS", :sym=>"Trail Head"}, ...]

Export waypoints to GPX file

g = GpxUtils::WaypointsExporter.new
lat = 52.384444
lon = 16.193056
name = "point"
cmt = "comment" # optional
time = "created_at" # optional
ele = 200 # 200m above sea level, optional
sym = "Trail Head" # Garmin icon string, optional
g.add(lat, lon, name, cmt, time, ele, sym)
#g.add(lat, lon, name) # w/o optional parameters
xml = g.to_xml
xmp # GPX file content

Create waypoint files

You can prepare your own list of waypoints and then store into Garmin eTrex device using a GPX file. At this moment there is only possible to convert data from YAML file to GPX. It is also possible to integrate with other (web)apps.

How to use it

  1. Check samples/sample_yaml_pois.yml as a template.

  2. Modify it, add yours POIs.

  3. Run command

generate_garmin_waypoints -y input_file.yml > output.gpx

  1. You can check inter-POI distances using

generate_garmin_waypoints -y input_file.yml -C

Distance conflict does not mean something is wrong. POIs can be close to each other so it is a good idea to have your brain turned on ;)

  1. You can change inter-POI distances using ‘latlon something’ distance for distance checking explained line before.

generate_garmin_waypoints -y samples/sample_yaml_pois.yml -C -t 1

  1. You can specify output file if you don’t like using >> ‘file.gpx’.

generate_garmin_waypoints -y samples/sample_yaml_pois.yml -o file.gpx

Contributing to gpx_utils

Copyright © 2012-2014 Aleksander Kwiatkowski. See LICENSE.txt for further details.