Tutorial: Smoothing & Simplifying Tracks
There are two options in GPS Visualizer's mapping and file conversion input forms that allow you to "simplify" your tracks: Max. points per track (trk_simplify) and trackpoint distance threshold (trk_distance_threshold). They both reduce the number of trackpoints (while preserving time stamps and other information), but in very different ways.
Max. points per track
GPS Visualizer's "max. points per track" option, which has been available since 2006, reduces the number of points in a track by passing the track through GPSBabel and asking GPSBabel's simplify filter to remove the most redundant points, based on how much those removals will affect the overall shape of the track (in technical terms, it measures "cross-track error").
So far, so good; the "max. points" setting works well on relatively clean data, and it's very useful if you need to reduce the number of points in a track because your GPS device has a specific limit. (For example, Garmin's older GPSMap units only allow 500 points per track.) But now let's look at an example where the "preserve the shape of the track" method doesn't work as well...
Obviously, we need another approach to cleaning up track data automatically. Which brings us to...
Trackpoint distance threshold
The newer "trackpoint distance threshold" filter examines each point in a track, in order, and discards every trackpoint that is not at least X distance from the last non-discarded point; you get to choose the value of X. If you don't supply a distance unit (feet, miles, etc.), the threshold given is assumed to be in meters.
By the way, here's what happens if we apply an appropriate distance threshold filter to the jagged second example in the "Max. points per track" section at the top of this page; it's a much better result:
Choosing a threshold
The question is, what distance should you use as a trackpoint distance threshold? That depends on a few things. Obviously, with a very small threshold, lots of detail will be preserved, but so will some of the artifacts. But a threshold that's too big will smooth things out too much and cause you to lose sharp corners and switchbacks. Speed is an important consideration; if the track was recorded in a car or on a bicycle, a larger threshold is appropriate, because the trackpoints will typically be farther apart. (In fact, tracks recorded in a car probably need very little filtering anyway, unless there were a lot of stops that may have produced GPS "wandering." Also, many GPS units are already set up to only record points once a certain distance has been traveled anyway; if that's the case, GPS Visualizer's filter is redundant.)
The following animated graphic is a real-world demonstration of the effects of different trackpoint thresholds on two different tracks that were recorded on hiking trails. (Note that the scale of the two halves of the graphic is slightly different; the left side is zoomed in one step closer.) The "knots" in the track occurred when the hiker stopped to rest or take photos; obviously we want those knots unraveled.
But how much smoothing is too much? On the right side, near the center, there is a sharp rightward-pointing angle that really is part of the trail; at threshold=8m, that corner disappears, so the best choice for that track might be about 4m. On the left side, however, there's a sharp zigzag in the upper-right part of the map that is still there at threshold=4m; maybe something like 8m would be a better choice there. On both sides, we can see that a threshold of 1m or 2m can't possibly hurt anything, whereas anything above 16m starts to look ridiculous. (Your threshold doesn't have to be a power of 2; these are just examples.)
Combining the two track filters
Yes, the two methods of track simplification can be used together. The distance threshold is applied first, and the angle-based point reduction (maximum number of points) is applied second. So you can use a distance filter to clean up the GPS artifacts, and limit the number of points in the output, all in one fell swoop.