Automatic file format detection

Almost every GPS software and device on the market seems to use its very own, very special way of storing routes, tracks and waypoints. You don't need to worry about this. RouteConverter helps you cut through this jungle of formats by automatically detecting the format of any file containing GPS data, rather than relying on the file name extension.

When a file is read, every supported file format is tried automatically to detect its format and read the data. During this detection phase the currently active format is displayed:

RouteConverter showing the detected format of an opened file

Just drag and drop a GPS file into RouteConverter, wait a second or two and have a look at the information that RouteConverter displays after it loaded the data:

File information panel listing the data inside a GPS file

Here you can see:

  • RouteConverter has detected the format of the file as "Google Earth 5 (*.kml)"
  • The file contains 5 position lists: 1 route, 2 tracks and 2 waypoint lists
  • The currently displayed position list is a track named "Sebastian's Runmeter-Cycle-20110806-1034"
  • The track contains 2548 positions and covers 122.5 kilometers. The sum of all ascents between its positions is 1427 meters, and the sum of all descents is 1355 meters.

Multiple position lists within one file are supported for the following formats:

Technical background

A computer science principle for implementing robust programs is:

Be lenient when reading data and strict when writing data.

If RouteConverter stuck to the file extension when reading files, or relied on the user to choose the format, the result could easily be wrong: RouteConverter would try to fill its internal data structures from data found in the file. To avoid crashing, it would have to apply a lot of checks and tests to validate the data it read. This robustness is invisible to the user but expensive to implement.

So I've made a feature out of it: RouteConverter automatically detects the format of any file and reads the GPS data from it. The file extension is taken as a first hint about which formats to try first. Then all the supported formats attempt to read the file.

Some formats are too strict and reject files that were actually intended for them — this happens quite often with XML-based formats such as GPX and KML. Other formats are too greedy and interpret all data even when they don't understand it — Garmin's POI database format frequently presents garbage to the user.