<?xml version="1.0" encoding="UTF-8" ?>
      
      <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
      
      <channel>
        <title>davidsizemore.com :: Blog</title> 
        <link>http://www.davidsizemore.com/blog/</link> 
        <description>David Sizemore's Blog</description> 
        <copyright>Copyright 2008, David Sizemore</copyright>
        <ttl>30</ttl>
      		<item>
      			<title>Generating Google Maps files from GPS data - Part 2</title>
      			<link>http://www.davidsizemore.com/blog/archive.php?id=177#177</link>
      			<description>
      				<![CDATA[
      					I <a href="http://www.davidsizemore.com/blog/archive.php?id=176#176">previously discussed</a> my method for generating Google Maps files with a single click. Since then I have made some modifications to my GPSBabel XCSV style file. The best way to highlight these changes is to view a <a href="http://www.davidsizemore.com/blog/files/havasu.html">sample map</a> generated with this process.<br />
<br />
Some of the changes include:<br />
<br />
<ul><br />
<li>Date and time for start and end points for each day</li><br />
<li>Altitude for start and end points for each day</li><br />
<li>Maximum (<img src="http://labs.google.com/ridefinder/images/mm_20_yellow.png">) and minimum (<img src="http://labs.google.com/ridefinder/images/mm_20_blue.png">) altitude for each day</li><br />
<li>Distance traveled in a given day - shown in the end marker balloon</li><br />
<li>Total trip distance traveled for all days - shown in info panel</li><br />
<li>Button to show/hide the track lines - in case you want to see the name of a road, for example</li><br />
<li>Button to show/hide an info panel in the lower right corner with total trip distance and coordinates of mouse/last click</li><br />
</ul><br />
<br />
Initially, the Google Maps HTML files I was getting from multi-day tracks were way too big and were basically grinding my browser to a halt. I used the GPSBabel simplify filter to remove extra data points which greatly reduced the resulting file size and increased performance significantly. The filter was applied as shown below:<br />
<blockquote><p><code>gpsbabel.exe -i gpx -f infile.gpx -x simplify,crosstrack,error=3.0m -o xcsv,style=google_maps.style -F outfile.html</code></p></blockquote><br />
<br />
Finding the total distance across multiple days ended up being a lot easier than I expected, thanks to a function in the Google Maps API, which resulted in this code:<br />
<br />
<blockquote><p><code>var total_miles = 0;<br />
var miles = poly[z].getLength() * 0.000621371192;<br />
total_miles = total_miles + miles;</code></p></blockquote><br />
<br />
All of the changes are available in the updated zip file available <a href="http://www.davidsizemore.com/blog/files/gpsbabel_workflow_20081026.zip">here</a>. I'm having additional discussions about this GPS datalogger and my workflow over on the <a href="http://www.gpspassion.com/forumsen/topic.asp?TOPIC_ID=112357">GpsPasSion forums</a> (starting on page two).
      				]]> 
        			</description>
      			<content:encoded>
      				<![CDATA[
      					I <a href="http://www.davidsizemore.com/blog/archive.php?id=176#176">previously discussed</a> my method for generating Google Maps files with a single click. Since then I have made some modifications to my GPSBabel XCSV style file. The best way to highlight these changes is to view a <a href="http://www.davidsizemore.com/blog/files/havasu.html">sample map</a> generated with this process.<br />
<br />
Some of the changes include:<br />
<br />
<ul><br />
<li>Date and time for start and end points for each day</li><br />
<li>Altitude for start and end points for each day</li><br />
<li>Maximum (<img src="http://labs.google.com/ridefinder/images/mm_20_yellow.png">) and minimum (<img src="http://labs.google.com/ridefinder/images/mm_20_blue.png">) altitude for each day</li><br />
<li>Distance traveled in a given day - shown in the end marker balloon</li><br />
<li>Total trip distance traveled for all days - shown in info panel</li><br />
<li>Button to show/hide the track lines - in case you want to see the name of a road, for example</li><br />
<li>Button to show/hide an info panel in the lower right corner with total trip distance and coordinates of mouse/last click</li><br />
</ul><br />
<br />
Initially, the Google Maps HTML files I was getting from multi-day tracks were way too big and were basically grinding my browser to a halt. I used the GPSBabel simplify filter to remove extra data points which greatly reduced the resulting file size and increased performance significantly. The filter was applied as shown below:<br />
<blockquote><p><code>gpsbabel.exe -i gpx -f infile.gpx -x simplify,crosstrack,error=3.0m -o xcsv,style=google_maps.style -F outfile.html</code></p></blockquote><br />
<br />
Finding the total distance across multiple days ended up being a lot easier than I expected, thanks to a function in the Google Maps API, which resulted in this code:<br />
<br />
<blockquote><p><code>var total_miles = 0;<br />
var miles = poly[z].getLength() * 0.000621371192;<br />
total_miles = total_miles + miles;</code></p></blockquote><br />
<br />
All of the changes are available in the updated zip file available <a href="http://www.davidsizemore.com/blog/files/gpsbabel_workflow_20081026.zip">here</a>. I'm having additional discussions about this GPS datalogger and my workflow over on the <a href="http://www.gpspassion.com/forumsen/topic.asp?TOPIC_ID=112357">GpsPasSion forums</a> (starting on page two).
      				]]> 
        			</content:encoded>
      			<comments>http://www.davidsizemore.com/blog/comments.php?id=177</comments>
      			<guid>http://www.davidsizemore.com/blog/archive.php?id=177#177</guid>
      			<pubDate>Sun, 26 Oct 2008 07:26:01 -0700</pubDate>
      		</item>
      		<item>
      			<title>Generating Google Maps files from GPS data</title>
      			<link>http://www.davidsizemore.com/blog/archive.php?id=176#176</link>
      			<description>
      				<![CDATA[
      					After a trip I like to generate a Google Maps file showing the track I took during that trip. In the past this could be a tedious process, as it required me to run my GPX file that I <a href="http://davidsizemore.com/blog/archive.php?id=174#174">generate</a> with GPSBabel through yet another application (<a href="http://sourceforge.net/projects/dgmanager-net/">DGManager.NET</a>), and even then, there was some HTML editing required to get things just right.<br />
<br />
I finally automated the process with the help of trusty GPSBabel, their XCSV style files, and some JavaScript. The hard part stemmed from the fact that GPSBabel does not have a way to pass the GPX 'bounds' element into the HTML file. This data is important to define the boundaries of the Google Map and the appropriate zoom level for your data. I finally wrote some JavaScript that handles this. My XCSV file can be downloaded <a href="./files/google_maps.style">here</a> and used with your own <a href="http://code.google.com/apis/maps/signup.html">Google Maps API key</a> (see the comments in the file for the correct location).<br />
<br />
I added the following line to <a href="http://davidsizemore.com/blog/archive.php?id=174#174">my original batch script</a> to create the Google Maps file in addition to the GPX file:<br />
<br />
<blockquote><p><code>"C:\Program Files\GPSbabel\gpsbabel.exe" -i gpx -f ..\%OUTPUT_FILENAME%.gpx -o xcsv,style="C:\Program Files\GPSbabel\google_maps.style" -F ..\%OUTPUT_FILENAME%.html</blockquote></p></code><br />
<br />
With <a href="./files/gpsbabel_workflow.zip">this updated script</a>, I now have a very short workflow to take a bunch of NMEA input files and create an optimized GPX file and corresponding Google Maps HTML file for posting <a href="./files/dc_walk.html">online</a>.
      				]]> 
        			</description>
      			<content:encoded>
      				<![CDATA[
      					After a trip I like to generate a Google Maps file showing the track I took during that trip. In the past this could be a tedious process, as it required me to run my GPX file that I <a href="http://davidsizemore.com/blog/archive.php?id=174#174">generate</a> with GPSBabel through yet another application (<a href="http://sourceforge.net/projects/dgmanager-net/">DGManager.NET</a>), and even then, there was some HTML editing required to get things just right.<br />
<br />
I finally automated the process with the help of trusty GPSBabel, their XCSV style files, and some JavaScript. The hard part stemmed from the fact that GPSBabel does not have a way to pass the GPX 'bounds' element into the HTML file. This data is important to define the boundaries of the Google Map and the appropriate zoom level for your data. I finally wrote some JavaScript that handles this. My XCSV file can be downloaded <a href="./files/google_maps.style">here</a> and used with your own <a href="http://code.google.com/apis/maps/signup.html">Google Maps API key</a> (see the comments in the file for the correct location).<br />
<br />
I added the following line to <a href="http://davidsizemore.com/blog/archive.php?id=174#174">my original batch script</a> to create the Google Maps file in addition to the GPX file:<br />
<br />
<blockquote><p><code>"C:\Program Files\GPSbabel\gpsbabel.exe" -i gpx -f ..\%OUTPUT_FILENAME%.gpx -o xcsv,style="C:\Program Files\GPSbabel\google_maps.style" -F ..\%OUTPUT_FILENAME%.html</blockquote></p></code><br />
<br />
With <a href="./files/gpsbabel_workflow.zip">this updated script</a>, I now have a very short workflow to take a bunch of NMEA input files and create an optimized GPX file and corresponding Google Maps HTML file for posting <a href="./files/dc_walk.html">online</a>.
      				]]> 
        			</content:encoded>
      			<comments>http://www.davidsizemore.com/blog/comments.php?id=176</comments>
      			<guid>http://www.davidsizemore.com/blog/archive.php?id=176#176</guid>
      			<pubDate>Mon, 06 Oct 2008 21:29:00 -0700</pubDate>
      		</item>
      		<item>
      			<title>Gas Mileage Log</title>
      			<link>http://www.davidsizemore.com/blog/archive.php?id=175#175</link>
      			<description>
      				<![CDATA[
      					I originally saw a good gas mileage calculator on another website a while back. Once I used it for a time or two I realized I could get a lot more information out of a few data points recorded at each fill up. I created a modified version of their file that will give you all sorts of information about your gas mileage. Download the MS Excel Document <a href="./files/Gas_Mileage_Log.xls">here</a>. <br />
<br />
Delete my sample data before you start (the data in white cells). You need to enter an initial odometer reading in B2, then continue with gas fill-ups in the white cells. Everything in light blue is automatically calculated.<br />
<br />
On the right hand side you can enter a distance (P3) to estimate how much a given trip will cost based on your average calculated cost per mile. You also need to enter the dates of your last Oil Change, Tire Rotation, and State Inspection in S2, T2, and U2. I have had a few issues with the scales on the graphs' Y-axis, so you may have to tweak those to fit your data. Everything else should be automatic!
      				]]> 
        			</description>
      			<content:encoded>
      				<![CDATA[
      					I originally saw a good gas mileage calculator on another website a while back. Once I used it for a time or two I realized I could get a lot more information out of a few data points recorded at each fill up. I created a modified version of their file that will give you all sorts of information about your gas mileage. Download the MS Excel Document <a href="./files/Gas_Mileage_Log.xls">here</a>. <br />
<br />
Delete my sample data before you start (the data in white cells). You need to enter an initial odometer reading in B2, then continue with gas fill-ups in the white cells. Everything in light blue is automatically calculated.<br />
<br />
On the right hand side you can enter a distance (P3) to estimate how much a given trip will cost based on your average calculated cost per mile. You also need to enter the dates of your last Oil Change, Tire Rotation, and State Inspection in S2, T2, and U2. I have had a few issues with the scales on the graphs' Y-axis, so you may have to tweak those to fit your data. Everything else should be automatic!
      				]]> 
        			</content:encoded>
      			<comments>http://www.davidsizemore.com/blog/comments.php?id=175</comments>
      			<guid>http://www.davidsizemore.com/blog/archive.php?id=175#175</guid>
      			<pubDate>Sun, 05 Oct 2008 20:15:00 -0700</pubDate>
      		</item></channel></rss>
