public static GPSTrajectory ReadLine(string line) { int split = line.IndexOf('\t'); int num = int.Parse(line.Substring(0, split)); GPSTrajectory gt = new GPSTrajectory(num); string[] data = line.Substring(split + 1).Split(new char[] { ',', '|' }); for (int i = 0; i < data.Length; i++) { int time = int.Parse(data[i++]); float lo = float.Parse(data[i++]); float la = float.Parse(data[i]); gt.AddPoint(lo, la, time); } return(gt); }
private GPSTrajectory Simplify() { _usePt = new bool[GPSPts.GPSCount]; for (int i = 0; i < GPSPts.GPSCount; i++) { _usePt[i] = true; } SimplifySection(0, GPSPts.GPSCount - 1); GPSTrajectory simplifiedLine = new GPSTrajectory(GPSPts.UserID); for (int i = 0; i < GPSPts.GPSCount; i++) { if (_usePt[i]) { simplifiedLine.AddPoint(GPSPts[i]); } } return(simplifiedLine); }