Importing GPX tracks into TangoGPS

tangoroute

TangoGPS is a wonderful tool to navigate using OpenStreetMap data. Currently though, it does not yet support the loading of track files. However, here is a little hack to insert track points from a GPX file into the tangoGPS POI database. This may be useful for rudimentary routing and for geocaching. As seen on the screenshot, a route is displayed as a series of unconnected track points.

The small script is written in python. It requires pysqlite2. It reads a gpx file, and inserts track points directly into the file poi.db which you can find in your .tangogps directory. It works for me and files generated by the Open Route Service. Your mileage may vary, and you might have to edit the regular expression which identifies the track points (Refer to the comments for using it with gpsbabel) . Don’t forget your backup.

Download here: gpx2tango.py

More tools:

  • loc2tango.py for those geocaching.com loc files.
  • pocket2tango.py for those geocaching.com pocket query GPX files. Includes basic information (and, optionally, hints) into waypoint information. Writes full html cache description to separate html file.

3 Comments so far
Leave a comment

Hello,

i just tried your script gpx2tango.py.
It works fine, but i had to switch the order of lat and lon, because in the GPX-file generated with gpsbabel, the order is lat-lon:
RE_TRKPT = ‘<trkpt lat=”([0-9\.]+)” lon=”([0-9\.]+)”‘
and:
lat, lon = match.groups()
Greetings,

Wolfram

Thank you for testing! I agree; for a clean implementation, I’d probably have to use an XML parser.

You forget to catch poi’s with cordinates less than 0. ;-) by the way.. but thanks for the script anyway



Leave a comment
Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

(required)

(required)