Friday, August 29, 2008

Using the I-Blue 747 with gpsbabel

Gpsbabel is the swiss army knife when it comes to GPS devices. With the application you can read waypoints, tracks and routes from a great number of devices in many different formats. At th same time you can convert between all those formats as well as manipulate the data in the proceedings.

The I-Blue 747 is a mtk loging device. Rather than storing a gpx formated text file with the GPS information it does store that data in a binary file format. It is able to read the binary mtk information and write it to any of the supported gps data formats such as the popular gpx as well as the kml file being used by Google Earth.

1. Installation of gpsbabel
You can try to install gpsbabel using the software package manager that comes with your favorite Linux distro. When doing so under OpenSuse 11.0 it did install an oder version of gpsbabel which did not recognize the mtk file format. So I went to the gpsbabel website and downloaded a precompiled i386 binary which I then did install:

>rpm -Uhv gpsbabel-1.3.5-0.i386.rpm

2. Reading the data from the device
Most GPS data programs support the gpx file format. If you like to use the GPS data to add it as meta data to your images from a shoot this is the way to go in most case. In order to read from the device you will have to connect it via the USB mini cable and switch to logging mode. In the following example we will read the data and convert it on the fly to a gpx data file:

>gpsbabel -t -w -i mtk -f /dev/ttyUSB0 -o gpx -F OUTFILE.gpx

If you would like to do some houese keeping at the same time you can delete the data you have just read from the device, freeing the memory and have it spring clean for the next trip or shoot:

>gpsbabel -t -w -i mtk,erase -f /dev/ttyUSB0 -o gpx -F OUTFILE.gpx

If you need the same GPS data in different file formats, you can add another output option along with another output file. The next example will read the GPS data and convert it to a gpx file for geotagging. The second output section will create a kml file with which the trip can be viewed using google earth:

>gpsbabel -t -w -i mtk,erase -f /dev/ttyUSB0 -o gpx -F OUTFILE.gpx \
-o kml -F OUTFILE.kml

So there you go. I myself have banged together a little bash script that will download the data add a time stamp and save the data in a defined directory on my machine:

#!/bin/bash
#Read the matk binary data from mtk device, such as an I-BLUE 747.
#Convert the data to gpx and kml format.
#Store the data in $HOME/Documents/gps adding a time stamp
#and a unique file identifier by adding the process ID of
#the script ($$) to the file name.

BASE=$HOME/Documents/gps
DATE=`date +%Y%m%d`


gpsbabel -t -w -i mtk,erase -f /dev/ttyUSB0 -o gpx -F $BASE/GPS_$DATE_$$.gpx \
-o kml $BASE/GPS_$DATE_$$.kml


Feel free to use and or modify the script to your personal needs. If the script burns down your house or kills your cat I am not to be hold responsible :-) You the script at your own risk!

Cheers
Juergen

No comments: