freebourg
08-31-2008, 04:53 PM
First, excuse me for my so bad english.
I travelled a bit and collected some gps log data into gpx format (which is XML). See this : http://www.topografix.com/gpx.asp
I used gpxlogger in order to do the work (read the output of gpsd and write it in the gpx file).
Here's a normal log :
<gpx>
<trk>
<trkseg>
<trkpt lat="46.755572" lon="7.152242">
<ele>nan</ele>
<time>2008-08-30T12:37:02Z</time>
<fix>2d</fix>
</trkpt>
<trkpt lat="46.755572" lon="7.152242">
<ele>724.600000</ele>
<time>2008-08-30T12:37:03Z</time>
<fix>3d</fix>
</trkpt>
</trkseg>
</trk>
</gpx>
Sometimes (half the time in fact...), gpxlogger write this :
<trk>
<trkseg>
<trkpt lat="nan" lon="nan">
<ele>nan</ele>
<time>1901-12-13T20:45:52Z</time>
<fix>3d</fix>
</trkpt>
</trkseg>
</trk>
The problem is that some software (for example bikeXperience & Google Maps) don't like these.
Can somebody help me :
- Tell gpxlogger to shut up when this case happens, would be the simpliest solution
- It may exist some filter for gpsbabel to remove these bad tracks
- Write a script that remove this and print a correct gpx file
- A good solution must be to write "Regular expressions" to do this, but I failed. Does someone know which string work in this case ?
Thanks in advance,
Mathieu.
I travelled a bit and collected some gps log data into gpx format (which is XML). See this : http://www.topografix.com/gpx.asp
I used gpxlogger in order to do the work (read the output of gpsd and write it in the gpx file).
Here's a normal log :
<gpx>
<trk>
<trkseg>
<trkpt lat="46.755572" lon="7.152242">
<ele>nan</ele>
<time>2008-08-30T12:37:02Z</time>
<fix>2d</fix>
</trkpt>
<trkpt lat="46.755572" lon="7.152242">
<ele>724.600000</ele>
<time>2008-08-30T12:37:03Z</time>
<fix>3d</fix>
</trkpt>
</trkseg>
</trk>
</gpx>
Sometimes (half the time in fact...), gpxlogger write this :
<trk>
<trkseg>
<trkpt lat="nan" lon="nan">
<ele>nan</ele>
<time>1901-12-13T20:45:52Z</time>
<fix>3d</fix>
</trkpt>
</trkseg>
</trk>
The problem is that some software (for example bikeXperience & Google Maps) don't like these.
Can somebody help me :
- Tell gpxlogger to shut up when this case happens, would be the simpliest solution
- It may exist some filter for gpsbabel to remove these bad tracks
- Write a script that remove this and print a correct gpx file
- A good solution must be to write "Regular expressions" to do this, but I failed. Does someone know which string work in this case ?
Thanks in advance,
Mathieu.