Hiding home location with GPSBabel
ایہہ 1؍April 2008ء English وچ «ArtyCarty479831» لیکھ چھپیا گیا سی۔It's easy to collect GPS track logs when driving around running errands. Since I'm in the US, I don't need to gather street names for most streets; I just need tracks to align the Tiger data.
The easy thing to do is turn on my GPS logger, set it on the car dashboard, and drive around. When I get home, pick it up off the dashboard and turn it off. Easy to do, but only one problem: I am paranoid, and I don't want every public tracklog showing my driveway. Yes, it is probably silly, but there it is.
One choice is to not turn on track logging until I am a block or two away from home, and then turn it off a block or two before getting home. It works, but it can be distracting while driving. I could also edit the GPX file with a text or xml editor, but that is repetitive and boring.
The best solution is GPSBabel, which is made just for this type of thing. It has a processing filter which can include or exclude points that lie within a boundary which you define.
I'm already using GPSBabel to translate my GPS tracks from the Coto Palm GPS software into GPX format, so I figured this would be an easy addition to the process. It took more work than I expected, because of an obscure detail in the processing. GPSBabel only wants to apply the filtering to defined waypoints, and not to tracks. Fortunately, GPSBabel itself can solve this problem, too. I told it to translate the tracks into waypoints, filter, then translate back to tracks. It added waypoint names for every track point, but I could easily delete those.
The end result is a shell script looking something like this:
F=$1
NewFileName=` echo $F | sed -e 's/\.pdb$//i' | tr ' ' '_' `.gpx
#Convert trackpoints to waypoints, for exclusion to work,
# then convert back
gpsbabel \
-i coto -f "$F" \
-x discard,hdop=6 \
-x transform,wpt=trk,del \
-x polygon,file=$ExcludeFile,exclude \
-x transform,trk=wpt,del \
-o gpx -F - \
| grep -v -e '' -e '' -e '' \
>"$NewFileName"
Discussion
ایہہ 3؍April 2008ء 12:51 تے «Steve Hill» ٹپݨی کیتی گئی سی۔
See my diary entry: osm.org/user/Steve Hill/diary/1272