Exemple #1
0
        public string GetOneTrajectory(int userID, int index)
        {
            GPSTrajectory gt     = myUserTrajectories.GetTrajectoriesByUserID(userID)[index];
            string        result = gt.ToJSON();
            //添加速度
            StringBuilder sb = new StringBuilder();

            sb.Append("\"Velocity\":[0,");
            for (int i = 1; i < gt.GPSCount; i++)
            {
                sb.Append(gt[i].Velocity * 3.6);
                if (i != gt.GPSCount - 1)
                {
                    sb.Append(',');
                }
            }
            sb.Append(']');
            return(JSONConverter.AddElementsToJSON(result, sb.ToString()));
        }