2

I have collected GPS data on a journey by extracting it every second from the $GPRMC NMEA sentence, with each reading saved in the form:

time,latitude,longitude,speed,direction

a typical couple of lines are.

163044,5050.8427,-00049.8211,047.4,107.6
163045,5050.8387,-00049.8012,047.2,106.5

Note: I am using Linux, and a Processing sketch to extract the data and save it in a file made unique by including the date and time of its creation in its name, e.g. posns20150321131751.txt

I intend to plot this as a trace on an OpenStreetMap which requires data in osm format.

This is my Linux command line and error message:

[Harry@localhost]~/Gpsbabel% gpsbabel -i xcsv,style=/home/Harry/Gpsbabel/myidata.style -f /GPStalk/posns20150321131751.txt -o osm ~/GPStalk/posn01.osm 
CSV_UTIL : xcsv style "%H%M%S" is missing default. 

My style file myidata.style is:

FIELD_DELIMITER    COMMA
IFIELD GMT_TIME,"","%H%M%S"
IFIELD LAT_NMEA
IFIELD LON_NMEA
IFIELD IGNORE
IFIELD IGNORE

I find the documentation in the GPSBabel documentation difficult to follow, so my question is, please, where have I gone wrong? In particular, what is wrong with my style file myidata.style?

5
  • I would convert to gpx then import to openstreetmap wiki.openstreetmap.org/wiki/… upload wiki.openstreetmap.org/wiki/Upload_GPS_tracks – Mapperz Mar 22 '15 at 18:04
  • Thanks @Mapperz, but the problem is that I cannot convert my data to gpx format in the first place, which is why I asked for help. – Harry Weston Mar 22 '15 at 22:29
  • NMEA to GPX online gpsvisualizer.com/gpsbabel – Mapperz Mar 23 '15 at 1:01
  • Thanks again @Mapperz. I already looked at gpsvisualiser when I first tried to do the conversion. the problem is that, in order to save storage space I have selected only the fields I need, rather than the whole NMEA sentence. So, which of the formats listed in gpsvisualiser do I use? If none apply, how do I define my own (that is the real question)? – Harry Weston Mar 23 '15 at 11:32
  • 1
    What I really want to know is how to avoid the error message from Gpsbabel. – Harry Weston Mar 23 '15 at 11:36
2

I have found the answer to my specific problem: To avoid the error messages I had to alter the style file to this, adding extra information to the field definitions:

EXTENSION  txt
PROLOGUE Time Latitude Longitude Speed Direction
FIELD_DELIMITER    COMMA
IFIELD GMT_TIME,"","%H%M%S"
IFIELD LAT_NMEA, "", "%09.4f"
IFIELD LON_NMEA,  "", "%010.4f"
IFIELD IGNORE,"", "%s"
IFIELD IGNORE,"", "%s"

I also changed to a .gpx output file, rather than .osm as that seemed more generally useful in other software. So now it produced a .gpx file, but I could not upload it to OpenStreetMap, getting the error message:

Found no good GPX points in the input data

The error message has a link to a site that explains some of the reasons for failure, and includes the statement: Why didn't my GPX file upload properly? Your GPX should consist of trackpoints... Eventually I realised the significance of this, so altered my style file (added DATATYPE TRACK) and command (adding the -t option) to treat the data (now from a different set with the same layout) as a track, instead of waypoints:

EXTENSION  txt
PROLOGUE Time,Latitude,Longitude,Speed,Direction
FIELD_DELIMITER    COMMA
DATATYPE TRACK
IFIELD GMT_TIME,"","%H%M%S"
IFIELD LAT_NMEA, "", "%09.4f"
IFIELD LON_NMEA,  "", "%010.4f"
IFIELD IGNORE,"", "%s"
IFIELD IGNORE,"", "%s"

gpsbabel -t -i xcsv,style=/home/Harry/Gpsbabel/myidata.style -f /GPStalk/posns20150321161200.txt -o gpx -F /home/Harry/GPStalk/posn02.gpx

This was successful, and I now had a track that I could, at last, upload to OpenStreetMap.


I am submitting this to help others who might find themselves facing the same problem, and will accept it as an answer, when I am able, if no more authoritative answer is forthcoming.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.