Nearly lost gpx trace

Yet again I get to copying sd traces from my gps and find that the file systems corrupt.

However this time I’ve tried to recover it. I ran an fsck on the card and it found lots of little 16kb chunks. Great.

A little perseverance with gpsbabel and I’ve managed to combine them (chucking out all the dodgy records).


Here’s what I did in case anyone’s interested


#!/bin/bash
FILE2=""
for file in "$@"; do
FILE2="${FILE2} -f $file";
done
echo $FILE2
gpsbabel -i nmea $FILE2 \
-x discard,hdop=5.5 \
-x transform,wpt=trk,del \
-x transform,trk=wpt,del \
-o gpx -F - \
| grep -v -e '' -e '' -e '' \
| gpsbabel \
-i gpx -f - \
-x track,merge,split=5m,title="T%Y%m%d-%H%M" \
-o gpx -F "fixed.gpx"

I ran fixthemess *.REC and out came a relatively good gpx trace 🙂

May 20, 2009 · robert · Comments Closed
Tags: , , ,  · Posted in: Uncategorized