In the example subdirectory there are a number of small examples. On this page these examples are described.
The gpxtest tool performs a self-test of the library. It uses the file 'test.gpx' as input. The syntax of the tool is:
The tool shows all the tests that are run and the result of the tests. At the end a summary is displayed.
The gpxls example is a little tool for showing a summary of the contents of a gpx file. The syntax of the tool is:
gpxls FILE ...
The tool shows the attributes of the gpx root node and the number of waypoints, routes and tracks per file. It is an example how to use the parser.
The gpxwpt example is a little tool for showing all the waypoint information in a gpx file. Its syntax is:
gpxwpt FILE ...
The tool shows for every waypoint per gpx file the latitude, longitude, elevation, time, name, comment, symbol and type. It is an example how to use the list of waypoints used in the library.
The gpxtrk example is a little tool for showing the track information in a gpx file. Its syntax is:
gpxwpt FILE ...
The tool shows for every track the track description, the track segments and every track point in the track segments. Per trackpoint the latitude, longitude, elevation, time, name and comment is displayed.
The tool gpxtrkcon concats the second till the last track in the gpx file to the first track resulting in one track with all the track segments. This gpx document is then written to stdout. The syntax is:
The tool gpxcsvtrk reads a comma separated text file with lat,lon points and converts those to a gpx track file. Its syntax is:
gpxcsvtrk NAME FILE.csv [FILE.gpx]
The tool gpxi is an interactive gpx file reader or creator.
If no command line parameter is supplied it will create a gpx file based on the input of the user. The tool uses the inspection of the library to show the possible attributes and elements for the current node. When the user is finished, the resulting gpx document is written to stdout.
If a gpx file is entered as command line parameter, the user can browse the file with a menu.
The syntax of the tool is: