<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Convert Garmin 705 Navigator TCX Format using LINQ to XML and Data Objects &#8211; Article 1</title>
	<atom:link href="http://peterkellner.net/2008/08/16/convert-garmin-705-navigator-tcx-format-using-linq-to-xml-and-data-objects-article-1/feed/" rel="self" type="application/rss+xml" />
	<link>http://peterkellner.net/2008/08/16/convert-garmin-705-navigator-tcx-format-using-linq-to-xml-and-data-objects-article-1/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=convert-garmin-705-navigator-tcx-format-using-linq-to-xml-and-data-objects-article-1</link>
	<description>Microsoft Focused, JavaScript,HTML5 (ExtJS, SenchaTouch &#38; Windows 8 Metro)</description>
	<lastBuildDate>Tue, 15 May 2012 21:53:02 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: John</title>
		<link>http://peterkellner.net/2008/08/16/convert-garmin-705-navigator-tcx-format-using-linq-to-xml-and-data-objects-article-1/#comment-31627</link>
		<dc:creator>John</dc:creator>
		<pubDate>Mon, 14 Nov 2011 11:13:34 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/?p=353#comment-31627</guid>
		<description>Awesome code, well done mate</description>
		<content:encoded><![CDATA[<p>Awesome code, well done mate</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Umzug Berlin</title>
		<link>http://peterkellner.net/2008/08/16/convert-garmin-705-navigator-tcx-format-using-linq-to-xml-and-data-objects-article-1/#comment-30300</link>
		<dc:creator>Umzug Berlin</dc:creator>
		<pubDate>Tue, 02 Aug 2011 10:18:56 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/?p=353#comment-30300</guid>
		<description>Youre so cool! I dont suppose Ive read something like this before. So nice to seek out someone with some unique thoughts on this subject. realy thank you for starting this up. this website is one thing that is needed on the internet, someone with a bit originality. helpful job for bringing something new to the web!</description>
		<content:encoded><![CDATA[<p>Youre so cool! I dont suppose Ive read something like this before. So nice to seek out someone with some unique thoughts on this subject. realy thank you for starting this up. this website is one thing that is needed on the internet, someone with a bit originality. helpful job for bringing something new to the web!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill</title>
		<link>http://peterkellner.net/2008/08/16/convert-garmin-705-navigator-tcx-format-using-linq-to-xml-and-data-objects-article-1/#comment-28723</link>
		<dc:creator>Bill</dc:creator>
		<pubDate>Wed, 15 Dec 2010 02:04:08 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/?p=353#comment-28723</guid>
		<description>Meant to ask...am I seeing different perf than anyone else or is this expected w/above approach?</description>
		<content:encoded><![CDATA[<p>Meant to ask&#8230;am I seeing different perf than anyone else or is this expected w/above approach?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill</title>
		<link>http://peterkellner.net/2008/08/16/convert-garmin-705-navigator-tcx-format-using-linq-to-xml-and-data-objects-article-1/#comment-28722</link>
		<dc:creator>Bill</dc:creator>
		<pubDate>Wed, 15 Dec 2010 02:02:37 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/?p=353#comment-28722</guid>
		<description>I was happy to find this sample, I&#039;d like to graph the data my own way. However, it seems for any TCX that has lots of TrackPoints (  ...the performance of this approach is a non-starter ( in the matter of minutes...if you don&#039;t get a OutOfMemory exception thrown ).</description>
		<content:encoded><![CDATA[<p>I was happy to find this sample, I&#8217;d like to graph the data my own way. However, it seems for any TCX that has lots of TrackPoints (  &#8230;the performance of this approach is a non-starter ( in the matter of minutes&#8230;if you don&#8217;t get a OutOfMemory exception thrown ).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dave</title>
		<link>http://peterkellner.net/2008/08/16/convert-garmin-705-navigator-tcx-format-using-linq-to-xml-and-data-objects-article-1/#comment-28625</link>
		<dc:creator>dave</dc:creator>
		<pubDate>Tue, 30 Nov 2010 17:43:15 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/?p=353#comment-28625</guid>
		<description>i have created a program that will enable me to pick any lat/long point and have it sort through all of my workouts to tell me exactly quickly i passed between the two points - used to race against myself.  the program also interacts with google earth with KML files and with Excel to export all of your workout activities to a spreadsheet.

if you are interested in seeing the program email me at hockeydave26@hotmail.com and i will send you the code.

sorry that this didn&#039;t cut and paste well - but over time i have expanded on the first piece of code.  this will now take a list of .tcx files and create &#039;activity&#039; objects - although my objects differ from the first example i think you can get the idea (if you paste this back into Visual Studia and format it).

       

 private void extractDataFromXmlFile(string[] fileNames)
        {
            _myActivities.Clear();

            foreach (string fileName in fileNames)
            {
                try
                {
                    XElement root = XElement.Load(fileName);
                    XNamespace ns1 = &quot;http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2&quot;;

                    var activities = from activityElement in root.Elements(ns1 + &quot;Activities&quot;).Elements(ns1 + &quot;Activity&quot;)
                                     select new Activity
                                         {
                                             Sport = activityElement.FirstAttribute.Name.ToString(),

                                             Id = activityElement.Element(ns1 + &quot;Id&quot;) != null ? activityElement.Element(ns1 + &quot;Id&quot;).Value : &quot;ID Empty&quot;,

                                             Notes = activityElement.Element(ns1 + &quot;Notes&quot;) != null ? activityElement.Element(ns1 + &quot;Notes&quot;).Value : &quot;Notes Empty&quot;,

                                             Laps = (from lapElement in activityElement.Descendants(ns1 + &quot;Lap&quot;)
                                                     select new Lap
                                                         {
                                                             ID = lapElement.LastAttribute.Value != null ? Convert.ToString(lapElement.LastAttribute.Value) : DateTime.Now.ToString(),

                                                             TotalTimeSeconds = lapElement.Element(ns1 + &quot;TotalTimeSeconds&quot;) != null
                                                                     ? Convert.ToDouble((string)lapElement.Element(ns1 + &quot;TotalTimeSeconds&quot;).Value) : 0.00,

                                                             DistanceMeters = lapElement.Element(ns1 + &quot;DistanceMeters&quot;) != null ? Convert.ToDouble((string)lapElement.Element(ns1 + &quot;DistanceMeters&quot;).Value) : 0.00,
                                                             MaximumSpeed = lapElement.Element(ns1 + &quot;MaximumSpeed&quot;) != null ? Convert.ToDouble((string)lapElement.Element(ns1 + &quot;MaximumSpeed&quot;).Value) : 0.00,
                                                             Calories = lapElement.Element(ns1 + &quot;Calories&quot;) != null ? Convert.ToInt16((string)lapElement.Element(ns1 + &quot;Calories&quot;).Value) : 0,
                                                             AverageHeartRateBpm = lapElement.Element(ns1 + &quot;AverageHeartRateBpm&quot;) != null ? Convert.ToInt16((string)lapElement.Element(ns1 + &quot;AverageHeartRateBpm&quot;).Value) : 0,
                                                             MaximumHeartRateBpm = lapElement.Element(ns1 + &quot;MaximumHeartRateBpm&quot;) != null ? Convert.ToInt16((string)lapElement.Element(ns1 + &quot;MaximumHeartRateBpm&quot;).Value) : 0,
                                                             Intensity = lapElement.Element(ns1 + &quot;Intensity&quot;) != null ? lapElement.Element(ns1 + &quot;Intensity&quot;).Value : &quot;&quot;,
                                                             Cadence = lapElement.Element(ns1 + &quot;Cadence&quot;) != null ? Convert.ToInt16((string)lapElement.Element(ns1 + &quot;Cadence&quot;).Value) : 0,
                                                             TriggerMethod = lapElement.Element(ns1 + &quot;TriggerMethod&quot;) != null ? lapElement.Element(ns1 + &quot;TriggerMethod&quot;).Value : &quot;&quot;,
                                                             Notes = lapElement.Element(ns1 + &quot;Notes&quot;) != null ? lapElement.Element(ns1 + &quot;Notes&quot;).Value : &quot;&quot;,

                                                             Tracks = (from trackElement in lapElement.Descendants(ns1 + &quot;Track&quot;)
                                                                       select new Track
                                                                           {
                                                                               TrackPoints = (from trackPointElement in trackElement.Descendants(ns1 + &quot;Trackpoint&quot;)
                                                                                              select new TrackPoint
                                                                                                  {
                                                                                                      TimeAt = trackPointElement.Element(ns1 + &quot;Time&quot;) != null ? Convert.ToString((string)trackPointElement.Element(ns1 + &quot;Time&quot;).Value) : &quot;&quot;,
                                                                                                      AltitudeMeters = trackPointElement.Element(ns1 + &quot;AltitudeMeters&quot;) != null ? Convert.ToDouble((string)trackPointElement.Element(ns1 + &quot;AltitudeMeters&quot;).Value) : 0.0,
                                                                                                      DistanceMeters = trackPointElement.Element(ns1 + &quot;DistanceMeters&quot;) != null ? Convert.ToDouble((string)trackPointElement.Element(ns1 + &quot;DistanceMeters&quot;).Value) : 0.0,
                                                                                                      HeartRateBpm = trackPointElement.Element(ns1 + &quot;HeartRateBpm&quot;) != null ? Convert.ToInt16((string)trackPointElement.Element(ns1 + &quot;HeartRateBpm&quot;).Value) : 0,
                                                                                                      Cadence = trackPointElement.Element(ns1 + &quot;Cadence&quot;) != null ? Convert.ToInt16((string)trackPointElement.Element(ns1 + &quot;Cadence&quot;).Value) : 0,
                                                                                                      SensorState = trackPointElement.Element(ns1 + &quot;SensorState&quot;) != null ? trackPointElement.Element(ns1 + &quot;SensorState&quot;).Value : &quot;&quot;,

                                                                                                      Positionx = ((from positionElement in trackPointElement.Descendants(ns1 + &quot;Position&quot;)
                                                                                                                    select new Position
                                                                                                                        {
                                                                                                                            LatitudeDegrees = Convert.ToDouble((string)positionElement.Element(ns1 + &quot;LatitudeDegrees&quot;).Value),
                                                                                                                            LongitudeDegrees = Convert.ToDouble((string)positionElement.Element(ns1 + &quot;LongitudeDegrees&quot;).Value)

                                                                                                                        }).ToList())

                                                                                                  }).ToList()

                                                                           }).ToList()

                                                         }).ToList()

                                         };


                    foreach (Activity act in activities)
                    {
                        foreach (Lap lap in act.Laps)
                        {
                            lap.ElevationGainMeters = 0;

                            for (int i = 0; i &lt; lap.Tracks.Count; i++)
                            {
                                lap.Tracks[i] = processPoints(lap.ID, lap.Tracks[i]);

                                // this probably doesn&#039;t work either
                                lap.AvgMPH = lap.Tracks[i].AvgMPH;
                                // not sure this works with multi-tracks
                                // seem to get multi-tracks from full backup or training center not from garmin connect.
                                lap.ElevationGainMeters = lap.ElevationGainMeters + lap.Tracks[i].ElevationGainMeters;
                                lap.ElevationLossMeters = lap.ElevationLossMeters + lap.Tracks[i].ElevationLossMeters;
                            }

                            Console.WriteLine(&quot;Lap &quot; + lap.DistanceInMiles + &quot; &quot; + lap.ElevationGainMeters);

                            act.Miles = act.Miles + lap.DistanceInMiles;


                            act.ElevationGainMeters = act.ElevationGainMeters + lap.ElevationGainMeters;
                            act.ElevationLossMeters = act.ElevationLossMeters + lap.ElevationLossMeters;

                            act.TotalTimeSeconds = act.TotalTimeSeconds + lap.TotalTimeSeconds;
                        }

                        _myActivities.Add(act);

                    }
                }
                catch (System.ArgumentException ex1)
                {
                    MessageBox.Show(ex1.InnerException.Message);
                }
            }

        }</description>
		<content:encoded><![CDATA[<p>i have created a program that will enable me to pick any lat/long point and have it sort through all of my workouts to tell me exactly quickly i passed between the two points &#8211; used to race against myself.  the program also interacts with google earth with KML files and with Excel to export all of your workout activities to a spreadsheet.</p>
<p>if you are interested in seeing the program email me at <a href="mailto:hockeydave26@hotmail.com">hockeydave26@hotmail.com</a> and i will send you the code.</p>
<p>sorry that this didn&#8217;t cut and paste well &#8211; but over time i have expanded on the first piece of code.  this will now take a list of .tcx files and create &#8216;activity&#8217; objects &#8211; although my objects differ from the first example i think you can get the idea (if you paste this back into Visual Studia and format it).</p>
<p> private void extractDataFromXmlFile(string[] fileNames)<br />
        {<br />
            _myActivities.Clear();</p>
<p>            foreach (string fileName in fileNames)<br />
            {<br />
                try<br />
                {<br />
                    XElement root = XElement.Load(fileName);<br />
                    XNamespace ns1 = &#8220;http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2&#8243;;</p>
<p>                    var activities = from activityElement in root.Elements(ns1 + &#8220;Activities&#8221;).Elements(ns1 + &#8220;Activity&#8221;)<br />
                                     select new Activity<br />
                                         {<br />
                                             Sport = activityElement.FirstAttribute.Name.ToString(),</p>
<p>                                             Id = activityElement.Element(ns1 + &#8220;Id&#8221;) != null ? activityElement.Element(ns1 + &#8220;Id&#8221;).Value : &#8220;ID Empty&#8221;,</p>
<p>                                             Notes = activityElement.Element(ns1 + &#8220;Notes&#8221;) != null ? activityElement.Element(ns1 + &#8220;Notes&#8221;).Value : &#8220;Notes Empty&#8221;,</p>
<p>                                             Laps = (from lapElement in activityElement.Descendants(ns1 + &#8220;Lap&#8221;)<br />
                                                     select new Lap<br />
                                                         {<br />
                                                             ID = lapElement.LastAttribute.Value != null ? Convert.ToString(lapElement.LastAttribute.Value) : DateTime.Now.ToString(),</p>
<p>                                                             TotalTimeSeconds = lapElement.Element(ns1 + &#8220;TotalTimeSeconds&#8221;) != null<br />
                                                                     ? Convert.ToDouble((string)lapElement.Element(ns1 + &#8220;TotalTimeSeconds&#8221;).Value) : 0.00,</p>
<p>                                                             DistanceMeters = lapElement.Element(ns1 + &#8220;DistanceMeters&#8221;) != null ? Convert.ToDouble((string)lapElement.Element(ns1 + &#8220;DistanceMeters&#8221;).Value) : 0.00,<br />
                                                             MaximumSpeed = lapElement.Element(ns1 + &#8220;MaximumSpeed&#8221;) != null ? Convert.ToDouble((string)lapElement.Element(ns1 + &#8220;MaximumSpeed&#8221;).Value) : 0.00,<br />
                                                             Calories = lapElement.Element(ns1 + &#8220;Calories&#8221;) != null ? Convert.ToInt16((string)lapElement.Element(ns1 + &#8220;Calories&#8221;).Value) : 0,<br />
                                                             AverageHeartRateBpm = lapElement.Element(ns1 + &#8220;AverageHeartRateBpm&#8221;) != null ? Convert.ToInt16((string)lapElement.Element(ns1 + &#8220;AverageHeartRateBpm&#8221;).Value) : 0,<br />
                                                             MaximumHeartRateBpm = lapElement.Element(ns1 + &#8220;MaximumHeartRateBpm&#8221;) != null ? Convert.ToInt16((string)lapElement.Element(ns1 + &#8220;MaximumHeartRateBpm&#8221;).Value) : 0,<br />
                                                             Intensity = lapElement.Element(ns1 + &#8220;Intensity&#8221;) != null ? lapElement.Element(ns1 + &#8220;Intensity&#8221;).Value : &#8220;&#8221;,<br />
                                                             Cadence = lapElement.Element(ns1 + &#8220;Cadence&#8221;) != null ? Convert.ToInt16((string)lapElement.Element(ns1 + &#8220;Cadence&#8221;).Value) : 0,<br />
                                                             TriggerMethod = lapElement.Element(ns1 + &#8220;TriggerMethod&#8221;) != null ? lapElement.Element(ns1 + &#8220;TriggerMethod&#8221;).Value : &#8220;&#8221;,<br />
                                                             Notes = lapElement.Element(ns1 + &#8220;Notes&#8221;) != null ? lapElement.Element(ns1 + &#8220;Notes&#8221;).Value : &#8220;&#8221;,</p>
<p>                                                             Tracks = (from trackElement in lapElement.Descendants(ns1 + &#8220;Track&#8221;)<br />
                                                                       select new Track<br />
                                                                           {<br />
                                                                               TrackPoints = (from trackPointElement in trackElement.Descendants(ns1 + &#8220;Trackpoint&#8221;)<br />
                                                                                              select new TrackPoint<br />
                                                                                                  {<br />
                                                                                                      TimeAt = trackPointElement.Element(ns1 + &#8220;Time&#8221;) != null ? Convert.ToString((string)trackPointElement.Element(ns1 + &#8220;Time&#8221;).Value) : &#8220;&#8221;,<br />
                                                                                                      AltitudeMeters = trackPointElement.Element(ns1 + &#8220;AltitudeMeters&#8221;) != null ? Convert.ToDouble((string)trackPointElement.Element(ns1 + &#8220;AltitudeMeters&#8221;).Value) : 0.0,<br />
                                                                                                      DistanceMeters = trackPointElement.Element(ns1 + &#8220;DistanceMeters&#8221;) != null ? Convert.ToDouble((string)trackPointElement.Element(ns1 + &#8220;DistanceMeters&#8221;).Value) : 0.0,<br />
                                                                                                      HeartRateBpm = trackPointElement.Element(ns1 + &#8220;HeartRateBpm&#8221;) != null ? Convert.ToInt16((string)trackPointElement.Element(ns1 + &#8220;HeartRateBpm&#8221;).Value) : 0,<br />
                                                                                                      Cadence = trackPointElement.Element(ns1 + &#8220;Cadence&#8221;) != null ? Convert.ToInt16((string)trackPointElement.Element(ns1 + &#8220;Cadence&#8221;).Value) : 0,<br />
                                                                                                      SensorState = trackPointElement.Element(ns1 + &#8220;SensorState&#8221;) != null ? trackPointElement.Element(ns1 + &#8220;SensorState&#8221;).Value : &#8220;&#8221;,</p>
<p>                                                                                                      Positionx = ((from positionElement in trackPointElement.Descendants(ns1 + &#8220;Position&#8221;)<br />
                                                                                                                    select new Position<br />
                                                                                                                        {<br />
                                                                                                                            LatitudeDegrees = Convert.ToDouble((string)positionElement.Element(ns1 + &#8220;LatitudeDegrees&#8221;).Value),<br />
                                                                                                                            LongitudeDegrees = Convert.ToDouble((string)positionElement.Element(ns1 + &#8220;LongitudeDegrees&#8221;).Value)</p>
<p>                                                                                                                        }).ToList())</p>
<p>                                                                                                  }).ToList()</p>
<p>                                                                           }).ToList()</p>
<p>                                                         }).ToList()</p>
<p>                                         };</p>
<p>                    foreach (Activity act in activities)<br />
                    {<br />
                        foreach (Lap lap in act.Laps)<br />
                        {<br />
                            lap.ElevationGainMeters = 0;</p>
<p>                            for (int i = 0; i &lt; lap.Tracks.Count; i++)<br />
                            {<br />
                                lap.Tracks[i] = processPoints(lap.ID, lap.Tracks[i]);</p>
<p>                                // this probably doesn&#039;t work either<br />
                                lap.AvgMPH = lap.Tracks[i].AvgMPH;<br />
                                // not sure this works with multi-tracks<br />
                                // seem to get multi-tracks from full backup or training center not from garmin connect.<br />
                                lap.ElevationGainMeters = lap.ElevationGainMeters + lap.Tracks[i].ElevationGainMeters;<br />
                                lap.ElevationLossMeters = lap.ElevationLossMeters + lap.Tracks[i].ElevationLossMeters;<br />
                            }</p>
<p>                            Console.WriteLine(&quot;Lap &quot; + lap.DistanceInMiles + &quot; &quot; + lap.ElevationGainMeters);</p>
<p>                            act.Miles = act.Miles + lap.DistanceInMiles;</p>
<p>                            act.ElevationGainMeters = act.ElevationGainMeters + lap.ElevationGainMeters;<br />
                            act.ElevationLossMeters = act.ElevationLossMeters + lap.ElevationLossMeters;</p>
<p>                            act.TotalTimeSeconds = act.TotalTimeSeconds + lap.TotalTimeSeconds;<br />
                        }</p>
<p>                        _myActivities.Add(act);</p>
<p>                    }<br />
                }<br />
                catch (System.ArgumentException ex1)<br />
                {<br />
                    MessageBox.Show(ex1.InnerException.Message);<br />
                }<br />
            }</p>
<p>        }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dave</title>
		<link>http://peterkellner.net/2008/08/16/convert-garmin-705-navigator-tcx-format-using-linq-to-xml-and-data-objects-article-1/#comment-28624</link>
		<dc:creator>dave</dc:creator>
		<pubDate>Tue, 30 Nov 2010 17:31:04 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/?p=353#comment-28624</guid>
		<description>Roger download the latest Garmin Training Center and connect your 305 - it will upload all the activities - you can then export the ones you want to deal with to a .tcx file</description>
		<content:encoded><![CDATA[<p>Roger download the latest Garmin Training Center and connect your 305 &#8211; it will upload all the activities &#8211; you can then export the ones you want to deal with to a .tcx file</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: roger</title>
		<link>http://peterkellner.net/2008/08/16/convert-garmin-705-navigator-tcx-format-using-linq-to-xml-and-data-objects-article-1/#comment-28491</link>
		<dc:creator>roger</dc:creator>
		<pubDate>Thu, 11 Nov 2010 19:20:49 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/?p=353#comment-28491</guid>
		<description>I&#039;m using garmin forerruner 305.  I cannot see the .tcx files on a local drive.  Does anybody know how to access them?</description>
		<content:encoded><![CDATA[<p>I&#8217;m using garmin forerruner 305.  I cannot see the .tcx files on a local drive.  Does anybody know how to access them?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: justin</title>
		<link>http://peterkellner.net/2008/08/16/convert-garmin-705-navigator-tcx-format-using-linq-to-xml-and-data-objects-article-1/#comment-27720</link>
		<dc:creator>justin</dc:creator>
		<pubDate>Mon, 14 Jun 2010 22:47:18 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/?p=353#comment-27720</guid>
		<description>You&#039;ve probably long since forgotten about this but you are the &quot;I&#039;m Feeling Lucky&quot; for the Google query &quot;C# tcx file parser&quot; so I figured I&#039;d post a quick bug.  Your initial query looks for the Activities node (root.Descendants(ns1 + &quot;Activities&quot;)) when it should actually be iterating the Activity nodes.  That way if the user has the GPS track a multi-sport activity, like a triathlon, the laps get broken out into multiple Activity objects.  Of course you would need to have the method return the generic List and not the SingleOrDefault.</description>
		<content:encoded><![CDATA[<p>You&#8217;ve probably long since forgotten about this but you are the &#8220;I&#8217;m Feeling Lucky&#8221; for the Google query &#8220;C# tcx file parser&#8221; so I figured I&#8217;d post a quick bug.  Your initial query looks for the Activities node (root.Descendants(ns1 + &#8220;Activities&#8221;)) when it should actually be iterating the Activity nodes.  That way if the user has the GPS track a multi-sport activity, like a triathlon, the laps get broken out into multiple Activity objects.  Of course you would need to have the method return the generic List and not the SingleOrDefault.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://peterkellner.net/2008/08/16/convert-garmin-705-navigator-tcx-format-using-linq-to-xml-and-data-objects-article-1/#comment-27670</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Sat, 29 May 2010 18:19:52 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/?p=353#comment-27670</guid>
		<description>Thank you for a great program, I am a beginner in Linq, and I see how to get the information in Laps, but how do you get at the information in Tracks and Positionx? How does one list lead to the next?

Mark</description>
		<content:encoded><![CDATA[<p>Thank you for a great program, I am a beginner in Linq, and I see how to get the information in Laps, but how do you get at the information in Tracks and Positionx? How does one list lead to the next?</p>
<p>Mark</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dutchnomad</title>
		<link>http://peterkellner.net/2008/08/16/convert-garmin-705-navigator-tcx-format-using-linq-to-xml-and-data-objects-article-1/#comment-27555</link>
		<dc:creator>dutchnomad</dc:creator>
		<pubDate>Wed, 12 May 2010 13:21:52 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/?p=353#comment-27555</guid>
		<description>Is the zip file still somewhere available?</description>
		<content:encoded><![CDATA[<p>Is the zip file still somewhere available?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric</title>
		<link>http://peterkellner.net/2008/08/16/convert-garmin-705-navigator-tcx-format-using-linq-to-xml-and-data-objects-article-1/#comment-20376</link>
		<dc:creator>Eric</dc:creator>
		<pubDate>Sun, 15 Mar 2009 15:56:17 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/?p=353#comment-20376</guid>
		<description>Very interesting article,

I&#039;m in search of something a bit more unique. Every search I&#039;ve done point to the same thing.

I&#039;m trying to find devices, similarly to what the API is doing, but from code behind. Seeing that plug in is an ActiveX object I assume that wrapping the assembly in a managed class would give me the required functionality to do this. However, I cannot seem to either &quot;unlock&quot; the plugin in order to start the FindDevices() methods.

Have you tried this by any chance? Or know of any link I can point to, to help me out?

Regards,

Eric</description>
		<content:encoded><![CDATA[<p>Very interesting article,</p>
<p>I&#8217;m in search of something a bit more unique. Every search I&#8217;ve done point to the same thing.</p>
<p>I&#8217;m trying to find devices, similarly to what the API is doing, but from code behind. Seeing that plug in is an ActiveX object I assume that wrapping the assembly in a managed class would give me the required functionality to do this. However, I cannot seem to either &#8220;unlock&#8221; the plugin in order to start the FindDevices() methods.</p>
<p>Have you tried this by any chance? Or know of any link I can point to, to help me out?</p>
<p>Regards,</p>
<p>Eric</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stuart Lodge</title>
		<link>http://peterkellner.net/2008/08/16/convert-garmin-705-navigator-tcx-format-using-linq-to-xml-and-data-objects-article-1/#comment-18154</link>
		<dc:creator>Stuart Lodge</dc:creator>
		<pubDate>Thu, 05 Feb 2009 09:04:25 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/?p=353#comment-18154</guid>
		<description>Thanks for the post - wish I&#039;d stumbled across it 2 months ago. I went the &quot;xsd /classes&quot; route to parsing tcx files instead - but this looks cleaner.

I wonder which works faster...</description>
		<content:encoded><![CDATA[<p>Thanks for the post &#8211; wish I&#8217;d stumbled across it 2 months ago. I went the &#8220;xsd /classes&#8221; route to parsing tcx files instead &#8211; but this looks cleaner.</p>
<p>I wonder which works faster&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Randika</title>
		<link>http://peterkellner.net/2008/08/16/convert-garmin-705-navigator-tcx-format-using-linq-to-xml-and-data-objects-article-1/#comment-14413</link>
		<dc:creator>Randika</dc:creator>
		<pubDate>Wed, 24 Dec 2008 10:06:24 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/?p=353#comment-14413</guid>
		<description>Thank you for been generous</description>
		<content:encoded><![CDATA[<p>Thank you for been generous</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan</title>
		<link>http://peterkellner.net/2008/08/16/convert-garmin-705-navigator-tcx-format-using-linq-to-xml-and-data-objects-article-1/#comment-3686</link>
		<dc:creator>Jan</dc:creator>
		<pubDate>Tue, 16 Sep 2008 12:40:44 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/?p=353#comment-3686</guid>
		<description>HI, 

very good idea and i think the code is also very smart, but sorry i dont speak c#.net. 

I for myself tried to do a tcx lap combiner and the first tests where not that bad, but the code was very unhandy. 

Now i want to take a look at your solution with LINQ. I tried to convert to vb.net (witch i speak) but stuck in garmin.cs line 41... 

COULD you help or even better do you see a way how to combine c#.net and a vb.net development, because i think you intension to do a tcx tool is also in my interests. I´ve got enough ideas what else we can do with the Edge files.

That the output i´v got form converting.....
Public Class GarminUtils
	Public Shared Function ConvertTCS(fileName As String) As Activity
		Dim root As XElement = XElement.Load(fileName)
		Dim ns1 As XNamespace = &quot;http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2&quot;

		Dim activities As IEnumerable(Of Activity) = From activityElement In root.Descendants(Convert.ToString(ns1) &amp; &quot;Activities&quot;) _
			Select New Activity()

		Return activities.SingleOrDefault()
	End Function
End Class</description>
		<content:encoded><![CDATA[<p>HI, </p>
<p>very good idea and i think the code is also very smart, but sorry i dont speak c#.net. </p>
<p>I for myself tried to do a tcx lap combiner and the first tests where not that bad, but the code was very unhandy. </p>
<p>Now i want to take a look at your solution with LINQ. I tried to convert to vb.net (witch i speak) but stuck in garmin.cs line 41&#8230; </p>
<p>COULD you help or even better do you see a way how to combine c#.net and a vb.net development, because i think you intension to do a tcx tool is also in my interests. I´ve got enough ideas what else we can do with the Edge files.</p>
<p>That the output i´v got form converting&#8230;..<br />
Public Class GarminUtils<br />
	Public Shared Function ConvertTCS(fileName As String) As Activity<br />
		Dim root As XElement = XElement.Load(fileName)<br />
		Dim ns1 As XNamespace = &#8220;http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2&#8243;</p>
<p>		Dim activities As IEnumerable(Of Activity) = From activityElement In root.Descendants(Convert.ToString(ns1) &amp; &#8220;Activities&#8221;) _<br />
			Select New Activity()</p>
<p>		Return activities.SingleOrDefault()<br />
	End Function<br />
End Class</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching 54/56 queries in 0.013 seconds using disk: basic
Content Delivery Network via Amazon Web Services: S3: PetersBlogCDN.s3.amazonaws.com

Served from: peterkellner.net @ 2012-05-21 09:57:05 -->
