public static TopoStats FromTrack(ITopoTrackInfo track) { var stats = new TopoStats(); if (track == null || track.TopoPoints.Count() == 0) { return(stats); } stats.ElapsedTime = track.FinishUTC.Subtract(track.StartUTC); stats.Distance = GeoDistance.BetweenPoints(track.TopoPoints, true); stats.DistanceWithElevation = GeoDistance.BetweenPoints(track.TopoPoints, true); stats.EstimatedMetersAscent = GeoDistance.ElevationBetweenPoints(track.TopoPoints, 1).Meters; stats.EstimatedMetersDescent = GeoDistance.ElevationBetweenPoints(track.TopoPoints, -1).Meters; stats.SecondsBetweenPoints = stats.ElapsedTime.TotalSeconds / track.TopoPoints.Count(); stats.PointCount = track.TopoPoints.Count(); stats.DayCount = track.FinishLocal.DayOfYear - track.StartLocal.DayOfYear; return(stats); }
public string GetSourceName(ITopoTrackInfo track) { return(Path.GetFileNameWithoutExtension(track.Source)); }
public TopoPointInfo(ITopoTrackInfo track, IGpxPoint point) { _track = track; _point = point; }