Re: [Gpsbabel-misc] GPSBabel Filtering
GPSBabel converts and transfers data like waypoints, tracks & routes.
Brought to you by:
robertl
|
From: Ron P. <ro...@pa...> - 2007-05-30 17:20:27
|
Richard Mikalsen wrote: > Hello! > > Is it possible to change the way the filter works when filtering > duplicate waypoints? > > As far as I know, the output only contains a list _without_ > duplicates, but I would like to have a list of _only_ the duplicates. > > I'm using GPSBabel v1.3.3 That's not one of the options that's built in to the filter, but you can get those results with a little work: gpsbabel -i gpx -f in.gpx \ -x stack,push,copy \ -x duplicate,location \ -x stack,swap \ -x duplicate,location,all \ -x stack,pop,append \ -x duplicate,location,all \ -o gpx -F out.gpx This reads your file, makes a copy of it, removes all but one of any duplicated waypoints, swaps the one-of-each-waypoint copy with the copy of the original, removes all duplicate waypoints from that, and then sticks both copies of the list together again. This leaves exactly one of any waypoints that were originally duplicated, and two of any that were not. Then it uses the duplicate filter again, removing all of the waypoints that were originally unduplicated. It isn't pretty, though, nor as fast as it could be. If you're doing this a lot, and if you know some C, you might consider adding an option similar to the arc or polygon filters' "exclude" option to invert the sense of the test. |