Tutorial: Building Plain-Text Track Files
This tutorial will show you how to build or edit track files in plain-text format. Please feel free to contact me with any questions you might have about the topics listed below.
1: A simple track file
To ensure that your track data is read as tracks and not waypoints, include a "type" field and be sure to put a type of "T" on each line. If you prefer, you could also create a field called "trackpoint" and put numbers in that column.
2: Adding some more data fields
There are some fields you might want to define that will apply to the entire track: name, description, color, width, opacity, fill opacity, etc. To use these kinds of attributes, include them with the FIRST trackpoint; in any point after the first, they will generally be ignored.
The following are the informational fields which are typically only recognized in the first row of a track's data: name, desc, width, color, opacity, fill_color, fill_opacity.
If you want a track to be broken into multiple segments with a visible gap betwen them — but not into multiple tracks — you can use an eos field ("end of segment") to mark the last point in each segment.
If you supply a non-zero fill_opacity, your track will be drawn as a filled polygon. If you also have a non-zero "width" (which defines the thickness of the "stroke" on the track line, you may want to duplicate the first trackpoint again at the end of the track so that the boundary is a "closed" shape. With a stroke width of zero, however, closing the track will not have any visible effect.
3: Multiple tracks in a single text file
One way to put multiple tracks into a single file is to exactly repeat the header row when you want to start a new track. Any info (name, desc, etc.) that you put on the first line of the track will be used for that track in general. Note that if the second and subsequent headers don't match the first one EXACTLY, they'll just be ignored.
There are two other ways to start a new track, without having to repeat the headers:
4: Combining track and waypoint data in a single file
To combine waypoint and track data in a single file, add a "type" field to your data, and put "W" on the waypoint lines and "T" on the trackpoint lines. The T's and W's are always a good idea anyway, even if you only have one type of data; it removes any ambiguity.
It's probably easier, however, to just keep your waypoints in a separate file and upload them along with your tracks.
5: Forcing data to be read as both waypoints and tracks
To force a set of data to be both waypoints AND tracks -- without duplicating the data -- you can specify a type "R" for "routepoint." You can also use the "force type" menu under the text entry box.
[Return to the Tutorials index]
Return to the main GPS Visualizer page