For collecting GPS track logs suitable for uploading to Open Streetmap, gpsd includes a utility (gpxlogger) which connects to a running gpsd and generates those files. This is a link to its manpage.