[OSM-talk] GPSBabel scripts -Was: Re: GPSBabel screenshots
Ed Davies
osm at edavies.nildram.co.uk
Thu Sep 7 17:30:02 BST 2006
Robert Hart wrote:
> I have a shell script that gets the data from my gps into a standard folder
> with a name based on the current date. (of course this doesn't work if I do
> more than one upload a day). I'm planning to update it to attempt to copy
> photos off the camera to a sub-folder at the same time.
>
> #!/bin/sh
>
> DATE=`date +%Y%m%d`
> gpsbabel -i garmin -o gpx /dev/ttyS0 ~/gps/${DATE}w.gpx
> gpsbabel -t -i garmin -o gpx /dev/ttyS0 ~/gps/${DATE}t.gpx
Funny, mine's pretty similar:
#!/bin/sh
PORT=/dev/ttyS0
TARGET=~/projects/gpslogs
STAMP=`date --utc +%Y%m%dT%H%M`
echo Stamp $STAMP
echo Reading waypoints...
gpsbabel -i garmin -f $PORT -o gpx -F "$TARGET/${STAMP}waypoint.gpx"
echo Reading tracklogs...
gpsbabel -t -i garmin -f $PORT -o gpx -F "$TARGET/${STAMP}tracklog.gpx"
This includes the hour and minute in the filename to deal with
multiple uploads in a day. It also uses UTC rather than local
time which is a bit of over-engineering in this case, particularly
for somebody in the UK, but is consistent with the timestamps in
the GPX files and generally good practice for persistent data.
Ed.
More information about the talk
mailing list