title: Simplification / optimization of GPS track
body: <p>I've got a GPS track produced by <code>gpxlogger(1)</code> (supplied as a client for <a href="http://gpsd.berlios.de/" rel="nofollow noreferrer">gpsd</a>). GPS receiver updates its coordinates every 1 second, gpxlogger's logic is very simple, it writes down location (<code>lat</code>, <code>lon</code>, <code>ele</code>) and a timestamp (<code>time</code>) received from GPS every <em>n</em> seconds (<em>n = 3</em> in my case).</p>
  
  <p>After writing down a several hours worth of track, gpxlogger saves several megabyte long GPX file that includes several thousands of points. Afterwards, I try to plot this track on a map and use it with <a href="http://openlayers.org/" rel="nofollow noreferrer">OpenLayers</a>. It works, but several thousands of points make using the map a sloppy and slow experience.</p>
  
  <p>I understand that having several thousands of points of suboptimal. There are myriads of points that can be deleted without losing almost anything: when there are several points making up roughly the straight line <em>and</em> we're moving with the same constant speed between them, we can just leave the first and the last point and throw away anything else.</p>
  
  <p>I thought of using <a href="http://www.gpsbabel.org/" rel="nofollow noreferrer">gpsbabel</a> for such track simplification / optimization job, but, alas, it's <a href="http://www.gpsbabel.org/htmldoc-1.4.2/filter_simplify.html" rel="nofollow noreferrer">simplification filter</a> works only with routes, i.e. analyzing only geometrical shape of path, without timestamps (i.e. not checking that the speed was roughly constant).</p>
  
  <p>Is there some ready-made utility / library / algorithm available to optimize <em>tracks</em>? Or may be I'm missing some clever option with gpsbabel?</p>