| davidsizemore.com | ||||||||
|
Generating Google Maps files from GPS data - Part 2
| 10:26 am
| Comment I previously discussed 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 sample map generated with this process.
Generating Google Maps files from GPS data
| 12:29 am
| CommentSome of the changes include:
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:
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:
All of the changes are available in the updated zip file available here. I'm having additional discussions about this GPS datalogger and my workflow over on the GpsPasSion forums (starting on page two). 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 generate with GPSBabel through yet another application (DGManager.NET), and even then, there was some HTML editing required to get things just right.
Gas Mileage Log
| 11:15 pm
| Suggestions?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 here and used with your own Google Maps API key (see the comments in the file for the correct location). I added the following line to my original batch script to create the Google Maps file in addition to the GPX file:
With this updated script, 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 online. 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 here.
Geotagging Workflow
| 9:45 pm
| CommentDelete 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. 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! I have recently switched GPS data loggers from my trusty GlobalSat DG-100 to a Locosys BGT-31. The main reason for the switch was so that I could use external memory cards to store the data on long trips. I am very impressed with the BGT-31, but it isn't without its challenges. The main issue I have with it is that it either creates a binary file that you must read with their software, or you get NMEA text files. In order to minimize losses in the event of file corruption, I keep the log files to a maximum of 128KB. This can result in many files over the course of a long trip.
I'm Back!
| 11:05 pm
| Comment (2)In order to geotag my photos from a trip I prefer to use GPicSync, which is easier to use with a single GPX input file. In order to create that single GPX file from the many individual NMEA text files, I use GPSBabel. GPSBabel is great, but there is no native way that I have found to easily select a bunch of input files from the command line, so I wanted something to automate it for me. I finally gave up finding an existing tool to do this, so I wrote a little batch script to do it for me. You can download a zip file containing the script here. Basically, here's how I use it: Place the batch file into your GPSbabel directory (I assumed C:\Program Files\GPSbabel\). Add the registry key to your registry at "HKEY_CLASSES_ROOT\Folder\shell\Process GPS Files\command." You will now have a right-click context menu option titled "Process GPS Files" when you right-click on a folder. Right-click on the folder containing your NMEA GPS files, select the "Process GPS Files" menu option, enter your desired output filename, and hit enter. This will produce a GPX file in the parent directory of the folder you selected. Use the GPX file as input into GPicSync, and as a single backup file. You can also use the GPX file to create Google Earth KML files, or Google Maps files. Hello world? |
|
|||||||