示例#1
0
        /// <summary>
        /// Performs <see cref="ParseFixRecord(string)"/> on all valid strings.
        /// </summary>
        /// <param name="records">The records as <see cref="IList{string}"/></param>
        /// <returns>The <see cref="List{GPSLogEntry}"/>generated from the records.</returns>
        public static List <GPSLogEntry> ParseFixRecords(IList <string> records)
        {
            List <GPSLogEntry> ret  = new List <GPSLogEntry>();
            string             str  = records[1];
            DateTime           date = new DateTime(
                2000 + int.Parse(str.Substring(9, 2)),
                int.Parse(str.Substring(7, 2)),
                int.Parse(str.Substring(5, 2))
                );

            foreach (string record in records)
            {
                var temp = GPSLogEntry.ParseFixRecord(record, date);
                if (temp != null)
                {
                    ret.Add(temp);
                }
            }
            var aprFixes = GetApproximatingNodes(ret);

            foreach (var fix in aprFixes)
            {
                fix.ApproximatingFix = true;
            }
            return(ret);
        }
示例#2
0
        /// <summary>
        /// Performs <see cref="ParseFixRecord(string, DateTime)"/> on all valid strings.
        /// </summary>
        /// <param name="records">The records as <see cref="IList{string}"/></param>
        /// <param name="date">The Date to be given to this record(<see cref="DateTime"/>)</param>
        public static List <GPSLogEntry> ParseFixRecords(IList <string> records, DateTime date)
        {
            List <GPSLogEntry> ret = new List <GPSLogEntry>();

            foreach (string str in records)
            {
                var temp = GPSLogEntry.ParseFixRecord(str, date);
                if (temp != null)
                {
                    ret.Add(temp);
                }
            }
            return(ret);
        }
示例#3
0
        private double ComputeLength(List <GPSLogEntry> entries, bool approximate = false)
        {
            GPSLogEntry prev = null;
            double      ret  = 0;

            foreach (var entry in entries)
            {
                if (!approximate || entry.ApproximatingFix)
                {
                    if (prev != null)
                    {
                        ret += GlobalPoint.Distance(prev, entry);
                    }
                    prev = entry;
                }
            }
            return(ret);
        }