[Return to the Tutorials index]

Tutorial: Building Plain-Text Track Files

Contents

This tutorial will teach you how to build or edit track files in plain-text format. Until it is completed, 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.

Creating polygons

Note that if you supply a non-zero fill opacity, your track will be drawn as a filled polygon in Google Maps or Google Earth. 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:

  • Include an "end_track" field (or "EOT" for "end of track") and give it a value of 1 in the last point of the track.
  • Include a "new_track" field (or "BOT" for "beginning of track") and give it a value of 1 in the first point of the new track.

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 top]

[Return to the Tutorials index]





Return to the main GPS Visualizer page


EveryTrail.com Guides:
Print or download travel guides to your iPhone or GPS: Skyline to the Sea Trail • Hiking the Grand Canyon Rim to Rim • Half Dome • The Boston Freedom Trail • Upper Yosemite Falls Hike • Lands End, San Francisco • Angel Island State Park • Cataract Trail Loop in Marin County • Coyote Creek Loop at Henry Coe State Park • Half Moon Bay Coastal Trail • Bay Area Wildflower Hikes • Bay Area Scenic Drives • Sunol Wilderness • Stanford Dish Hike • Grand Canyon: Kaibab to Bright Angel Trail • The Grand Canyon Rim Trail • Best Bay Area Backpacking • The High Sierra Trail • Best Bay Area Day Hikes • Great Hikes in the Grand Canyon • Queen's Garden Trail, Bryce Canyon Utah • Berry Creek Falls Loop at Big Basin Redwoods State Park • and more...