Логотипул OpenStreetMap OpenStreetMap

BitSchupser's Diary

Recent diary entries

I wrote a little shell script that processes various gpsbabel filters on gpx files, perhaps it is usefull for somewone else.

The following filters will be used:
- remove any trackpoints in the neighbourhood of your home (for privacy, do not forget to enter your position, lat= and lon=) (if you want to filter more regions you can duplicate the radius,distance line)
- remove any trackpoints that have a distance < 2 meters
- remove duplicate trackpoints
- simplify the track (removes unnecessary trackpoints)
- remove trackpoints with a hdop > 4

Here is the script:

#!/bin/sh
if [ -z "$1" -o -z "$2" ]; then
echo "usage: $0 infile outfile"
exit 1
fi

tmpfile=$(mktemp)

gpsbabel -i gpx -f "$1" \
-x transform,wpt=trk,del \
-x radius,distance=0.8K,lat=48,lon=11,nosort,exclude \
-x transform,trk=wpt,del \
-x duplicate,location \
-x position,distance=2m \
-x simplify,crosstrack,error=0.001k \
-x discard,hdop=4 \
-o gpx -F "$tmpfile"

# removes some crap gpsbabel added to the file
sed '/^.*<name>.*$/d' "$tmpfile" | sed '/^.*<cmt>.*$/d' | sed '/^.*<desc>.*$/d' > $2

rm $tmpfile

Hi everybody. This is my first article in my OSM blog :-).
I just got a holder to mount my smart phone onto my bike. Tomorow I will start my first journey to collect data by bike - I think this will be much more fun than by car.
Near my hometown there are many villages and hamlets who need to be collected - much work for the summer holiday :-)

Location: Niederraunau, Krumbach (Schwaben), Landkreis Günzburg, Bavaria, 86381, Germany