See also at "downloads" for documentation

Examples

Create a GPX file with one track, one track segment and one track point

using MKCoolsoft.GPXLib;

...

// create new instance of GPXLib
GPXLib gpx = new GPXLib();

// create and init a new instance of Wpt for the track point.
Wpt wpt = new Wpt
    {
        Lat = (decimal)52.8379667,
        Lon = (decimal)8.3059667,
        Ele = (decimal)123.45,
        Time = DateTime.Now, 
        EleSpecified = true, 
        TimeSpecified = true 
    };

// Add the created track point to the "Example track" in track segment "0".
// If track or track segment doesn't exists, they will create.
gpx.AddTrackPoint("Example track", 0, wpt);

// Save the track to a file.
gpx.SaveToFile(@"C:\Example.gpx");

Fill GPXLib with content from a GPX file

using MKCoolsoft.GPXLib;

...

// create new instance of GPXLib
GPXLib gpx = new GPXLib();

// Load data from GPX file
gpx.LoadFromFile(@"C:\Example.gpx");

// Get the track point from the saved example.
// All lists have min. a length of 1 !!!
Wpt wpt = gpx.TrkList[0].TrksegList[0].TrkptList[0];

Last edited Feb 2, 2014 at 12:50 PM by Amboryus, version 3