Howto Edit GPX files

From OpenStreetMap Wiki
Jump to: navigation, search

Just open it up in a text editor and delete entire trackpoint entry from the xml.

Here's one of my trackpoints that I don't need:

  <trkpt lat="-37.772000" lon="145.024740">
   <ele>111.781</ele>
   <time>2007-09-15T23:47:07Z</time>
  </trkpt>

Here are your rough steps:

1) Open the track log $ java -jar josm-latest.jar 20070915.gpx

2) put your mouse over the cloud of points to be deleted, and write down the co-ordinates

3) Open the track log in your favourite text editor $ vi 20070915.gpx (or emacs, or Microsoft WordPad, or whatever)

4) Search for the co-ordinates you wrote down, leaving off the last part for precision.

5) Delete all points either side, by looking at the time. You should be able to work out when you stopped moving and roughly when you started again.

6) If you cross over a <trkseg> take out the end of the first </trkseg> and the beginning of the next, so you'd just end up with one <trkseg>.

7) After editing, you can run the resulting gpx file through GPSBabel going from gpx to gpx, and it will rebuild a correct bounding tag, which is nice if you've chopped a really long file into smaller bits.

Personal tools
Namespaces
Variants
Actions
site
Toolbox