static void Main(string[] args) { XmlReader reader = XmlReader.Create(FILENAME); XmlSerializer serializer = new XmlSerializer(typeof(gpxType)); gpxType gps = (gpxType)serializer.Deserialize(reader); trksegType[] seg = gps.trk[0].trkseg; wptType[] wpt = seg[0].trkpt; var points = wpt.Select(x => new { lat = x.lat, lon = x.lon, elevation = x.ele, time = x.time }).ToList(); }
static void Main(string[] args) { XmlReader reader = XmlReader.Create(FILENAME); XmlSerializer serializer = new XmlSerializer(typeof(gpxType)); gpxType gps = (gpxType)serializer.Deserialize(reader); trksegType[] seg = gps.trk[0].trkseg; wptType[] wpt = seg[0].trkpt; List <KeyValuePair <decimal, decimal> > points = wpt.Select(x => new KeyValuePair <decimal, decimal>(x.lon, x.lat)).ToList(); }
static void Main(string[] args) { XmlReader reader = XmlReader.Create(FILENAME); XmlSerializer serializer = new XmlSerializer(typeof(gpxType)); gpxType gps = (gpxType)serializer.Deserialize(reader); }