OpenStreetMap

Having purchased a Garmin GLO to “fix” the GPS problem I was having with my Nexus 5 I discovered:

  • OSMtracker doesn’t log fractions of a second, causing problems with points having the same time stamp and having tracks plot strangely in JOSM
  • 10 Hz updating makes for really big files

I tried both GpsPrune and the simply way tool in JOSM but neither were entirely satisfactory. GpsPrune requires you to enter a “span factor” that is specified as a fraction of the total span of the trace (so you can’t just enter a distance, you have to figure out what magic factor gives you the desired result for each trace), using JOSM you loose all of the elevation and HDOP data, and both of them have no way of specifying a maximum segment length.

The solution:

  1. Log data in NMEA format using the Ultra GPS Logger app.
  2. Simplify the track using GPS Babel:

    gpsbabel -i nmea -f input.txt -x simplify,crosstrack,error=0.0005k -x interpolate,distance=0.195k -o gpx -F output.gpx
    
  3. Using GpsPrune cut off the bits of the track you don’t want and export to GPX.
  4. Gzip the GPX file and upload it to OpenStreetMap.

The simplifying filter uses a cross track error of 0.5m which I’ve found to be a good compromise between the trace smoothness and the number of data points. The interpolation is needed because JOSM by default won’t draw segments longer than 200 m. I originally used distance=0.2k but this gives you a dashed line effect as each alternative segment is just a little under and a little over 200 m and 0.195k ensures that every segment will be drawn.

Here is an example from a trip from Apollo Bay to Colac with 1900 points in just over an hour of travel.

Discussion

Comment from richlv on 7 July 2015 at 10:23

beware - if you do full run on a roundabout or plot a parking lot, gpsbabel will drop more data than needed with the distance option… you can see some discussion here : http://comments.gmane.org/gmane.comp.hardware.gps.gpsbabel.general/6395

as you can guess, such traces are not that good for osm.

https://lists.openstreetmap.org/pipermail/talk-lv/2011-July/003040.html suggests a simple fix - in that version of gpsbabel, adding

else { break; }

after line 121

Log in to leave a comment