How to convert GPX File to KML file on Mac OS X.

Google Earth for Windows can open GPX file. But Google Earth for Macintosh can not open GPX file. You have to convert GPX File to KML file. (2006-01-23)

Get Garmin GPS Track log as GPX file

GPS Babel

You can convert GPX File to KML file by GPS Babel. Type gpsbabel command in Terminal.

gpsbabel -i gpx -f input.gpx -o kml -F output.kml

Note: GUI of GPS Babel did not work in Japanese mode of Mac OS X.

Drag and Drop convert

You can make Automator Application Icon for Drag and Drop convert.

The following is the perl script:

use strict;
stat ("/usr/local/bin/gpsbabel");
if (-e _ ){
 my $input = shift @ARGV;
 use File::Basename qw/ basename dirname/;
 my $basename = basename $input;
 my $dirname = dirname $input;
 $basename =~ s/\.GPX//i;
 $basename =~ s/\.XML//i;
 $basename = "$basename.kml";
 use File::Spec;
 my $outfile = File::Spec->catfile($dirname,$basename);
 system "/usr/local/bin/gpsbabel -i gpx -f $input -o kml -F $outfile";
}else{
 print STDERR "/usr/local/bin/gpsbabel is not found.";
 die;
}

You can get Automator Application from following URL:

Drop GPX file to the Automator Application Icon. Automator convert it to KML file with gpsbabel command.

LoadMyTracks can convert GPX to KML easily.

gpx2kml.com

gpx2kml.com is a free converter site. It does the conversion between GPX and KML files.

http://onohiroki.cycling.jp/tb/tb.cgi/gps-gpx2kml Trackback