Пример #1
0
        public static IDictionary <string, IList <GeoData> > GetGeoDataCollection(string filename)
        {
            Dictionary <string, IList <GeoData> > geoMap = new Dictionary <string, IList <GeoData> >();

            List <string> lines = File.ReadAllLines(filename).ToList();

            lines.RemoveAt(0);

            foreach (string line in lines)
            {
                GeoData         newGeoData  = GeoData.Parse(line);
                IList <GeoData> geoDataList = null;
                if (!geoMap.TryGetValue(newGeoData.Suspect, out geoDataList))
                {
                    geoDataList = new List <GeoData>();
                    geoMap.Add(newGeoData.Suspect, geoDataList);
                }
                geoDataList.Add(newGeoData);
            }

            return(geoMap);
        }
Пример #2
0
 public static byte[] GenerateTelemetryBytes(string id, GeoData geoData)
 {
     return Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(geoData));
 }
Пример #3
0
 public static byte[] GenerateTelemetryBytes(string id, GeoData geoData)
 {
     return(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(geoData)));
 }