[OSM-newbies] Removing Waypoints from GPX

Akkana Peck akkana at shallowsky.com
Sun May 31 21:32:33 BST 2009


Donald Campbell II wrote:
> So how do I strip the waypoint data from
> a GPX file so that I can upload the cleaned up tracks?

Mike Harris writes:
> Try a (free or shareware) utility such as www.gps.co.uk - or a simple text
> editor even.

Wow, are there really no open source programs that can strip
waypoint data from a GPX track+waypoint file, for people who
aren't comfortable editing XML by hand?

GPX files are really easy to parse in Python with xml.dom.minidom --
it took under an hour to write a little script to split out tracks
from a gpx file (if I save a track on my Garmin, when I import the
gpx file later with gpsbabel I get a file with multiple tracks
that apps like merkaartor can't read properly, so I split them
into separate files). It would probably be just as easy to make
it delete waypoints, or split them out to a separate file.

I'd be happy to extend my program to do that, if it would help
Donald process his data, but I'd need a sample file -- my Vista CX
puts track points and waypoints in separate files (or at least
that's what I get when I upload them with gpsbabel) so I haven't
seen what format they use when both are in the same file.

Donald, if you can send me a sample GPX file that has waypoints
that aren't sensitive, I can put a script online that may do
what you need. It sounds like this is something the open source
mapping community could use anyway -- nobody should have to edit
XML by hand, that's silly.

	...Akkana




More information about the newbies mailing list