private void writeGPX(string filename, Dictionary<string, PictureInformation> pictureList)
{
using (System.Xml.XmlTextWriter xw = new System.Xml.XmlTextWriter(Path.GetDirectoryName(filename) + Path.DirectorySeparatorChar + Path.GetFileNameWithoutExtension(filename) + ".gpx", Encoding.ASCII))
{
xw.WriteStartElement("gpx");
xw.WriteStartElement("trk");
xw.WriteStartElement("trkseg");
foreach (PictureInformation p in pictureList.Values)
{
xw.WriteStartElement("trkpt");
xw.WriteAttributeString("lat", p.Lat.ToString(new System.Globalization.CultureInfo("en-US")));
xw.WriteAttributeString("lon", p.Lon.ToString(new System.Globalization.CultureInfo("en-US")));
// must stay as above
xw.WriteElementString("time", p.Time.ToString("yyyy-MM-ddTHH:mm:ssZ"));
xw.WriteElementString("ele", p.RelAlt.ToString(new System.Globalization.CultureInfo("en-US")));
xw.WriteElementString("course", p.Yaw.ToString(new System.Globalization.CultureInfo("en-US")));
xw.WriteElementString("compass", p.Yaw.ToString(new System.Globalization.CultureInfo("en-US")));
xw.WriteEndElement();
}
xw.WriteEndElement();
xw.WriteEndElement();
xw.WriteEndElement();
}
}