#!/bin/bash
# usage:
#   nmea2kml < nmea-log.txt > track.kml
#
# convert NMEA track to KML track

if [ $# -ne 0 ]; then
  echo "usage: nmea2kml < nmea-log.txt > track.kml"
  exit
fi

grep -e "^\$GPRMC" -e "^\$GPGGA" -e "^\$GPVTG" -e "^\$GPGSA" | \
gpsbabel -t -i nmea -f - -x discard,hdop=10,vdop=20 -o kml,points=0,line_width=2,line_color=ff0000ff -F -
