public void Parse(Stream stream) { doc.Load(stream); foreach (XmlElement wpElement in doc.DocumentElement.GetElementsByTagName("wpt")) { WayPoint wp = new WayPoint(); wp.Parse(wpElement); wayPoints.Add(wp); } foreach (XmlElement trackElement in doc.DocumentElement.GetElementsByTagName("trk")) { Track trk = new Track(); trk.Parse(trackElement); tracks.Add(trk); maxEle = Math.Max(maxEle, trk.MaxElevation); minEle = Math.Min(minEle, trk.MinElevation); linearDistance += trk.LinearDistance; distance3D += trk.Distance3D; totalClimb += trk.TotalClimb; } }
public WayPoint(WayPoint wp) : base(wp) { name = wp.name; description = wp.description; }
public void LoadPhothos() { if (photoLoaded) return; string original = PathFunctions.GetImagePathFromGpx(sourceFile); if (Directory.Exists(original)) { int prog = 0; foreach (string file in Directory.GetFiles(original, "*.jpg")) { if (AlreadyAvailable(file)) continue; try { DateTime photoTime; double latidudeRef, latitude, longitudeRef, longitude; Helper.GetImageInfos(file, out photoTime, out latidudeRef, out latitude, out longitudeRef, out longitude); TrackPoint tp = GetPoint(photoTime, 1); if (tp != null) { WayPoint wp = new WayPoint(tp); wp.link = file; wp.name = Helper.GetImageTitle(file); if (string.IsNullOrEmpty(wp.name)) wp.name = Helper.GetImageCaption(prog++, wp.link); wayPoints.Add(wp); } } catch { } } } photoLoaded = true; }