Fun with GPS overlays

UPDATE - 2007: MapSource makes this easy for Garmin handhelds now - they have added a "show in Google Earth" option.

This morning I stumbled on a blog about using Google Earth with GPSs. Determined to finally get my copy of Google Earth to show a track file from my GPSmap 296, I followed a few of the links from that blog to decipher how to do it.



Google Earth is supposed to read the data right off the GPS, once you pay the $20 to upgrade. However, there are apparently well known problems using a Garmin USB device with it, so you have to go a ‘round about way.

The way I finally made it work was this (see comments below to learn how this is the TOO LONG way to do it):


  • Use Garmin MapSource to download the track files from the GPS
  • Save the MapSource file (a .gdb file)
  • Use the graphical interface of GPSBabel to convert the GDB file to a GPX XML file
  • Open this XML file in excel – Excel will load the data from it into columns
  • Pull the 3 columns that matter out of that file and copy them into a new excel file, in this order:

    • /trk/trkseg/trkpt/@lon
    • /trk/trkseg/trkpt/@lat
    • /trk/trkseg/trkpt/ele

  • Remove the column headers so that you are only left with the numeric data
  • Save this excel file, with its 3 columns, as a CSV (comma-seperated values) file
  • Open that CSV file in a text editor, like notepad
  • Create a new, blank text file called flight_track.kml
  • Put this XML data in the flight_track.xml file:
    <kml xmlns="http://earth.google.com/kml/2.0">
    <Placemark>
    <name>Flight Path</name>
    <styleUrl>root://styles#default+icon=0x307</styleUrl>
    <Style>
    <LineStyle>
    <color>ff0000ff</color>
    <width>2</width>
    </LineStyle>
    </Style>
    <LineString>
    <extrude>1</extrude>
    <tessellate>1</tessellate>
    <altitudeMode>absolute</altitudeMode>
    <coordinates>
    [PUT_NUMBERS_HERE]
    </coordinates>
    </LineString>
    </Placemark>
    </kml>

  • replace the text [PUT_NUMBERS_HERE] with the numeric data from the CSV file
  • Open the KML file in Google Earth (just double click the KML file once Google Earth is installed)


Whew! That's a lot of work - not something I will do for every flight. But the image shown here (click it for the BIG version) is pretty neat to look at (I tweaked the display of the track in Google Earth - yours will show up as a simple white line until you change the settings).

You can even see where we taxied on the ground at KFFA. You can also see my squiggly track on approaching and departing the area - I was making an attempt to minimize my time away from land.

Comments

Robert Lipe said…
I see this is an older post, but the "well known problems with using a Garmin USB device" are well behind GPSBabel and thus, Google Earth; the 296 has worked since '06.

You shouldn't have to hand-craft the KML, either. GPSBabel's KML writer should be able to produce almost exactly the file you show in a single step. Something like

gpsbabel -i garmin -f usb: -o kml,points=0,line_width=2,line_color=ff00000ff,floating,extrude -F flight_track.kml

should make a KML pretty close to what you show in a single step.

Enjoy.

Popular posts from this blog

Updating data on the Garmin Perspective system

Hiking to Rocky Peak in Steamboat Springs

G1000 transistion training - emergencies - final flight