I'm running GpsBabel 1.5.1, and would like to split a long, single-segment GPX file into 80km segments.
When using the following command, the output GpsBabel generates still only has a single track and a single segment:
gpsbabel.exe -t -i gpx -f input.gpx -x track,pack,sdistance=80k -o gpx -F output.gpx
I also tried this, same result:
gpsbabel.exe -t -i gpx -f input.gpx -x track,pack,sdistance=80k,split=5m -o gpx -F output.gpx
In case someone wants to give it a try, here's the file:
Does GpsBabel support splitting tracks into smaller segments?
Hi, and welcome.
That's actually not how our track filters work. It's not an unreasonable interpretation, but it's interesting that we're a few million users in before it comes up. Quoting from https://www.gpsbabel.org/htmldoc-development/filter_track.html
" input track will be split into several tracks if the distance between successive track points is greater than the distance given as a parameter."
so sdistance=80k means "break a track into parts if two consecutive (adjacent, next to each other) track points are > 80k apart. The typical use for this is GPSes that do silly things if you turn them off, check them in luggage, and then consider that last trackpoint at Heathrow and that first trackpoint in Miami as adjacent and draw a line between them.
The "split=5 minutes" bit just refines that you've lost signal for at least five minutes.
You seem to actuallly have one very large track - with nothing being separate by either 5 minutes or 80km.
If your goal is to just make your track smaller, you can split on one minute boundaries. 1 minute breaks it into 88 track segments.Without looking, that's probably something like driving through a train tunnel.
gpsbabel -i gpx -f Clermont-Ferrand_Avignon_single.track.gpx -x track,pack,split=1m -o gpx -F - | grep /trkseg | wc -l
It's probably useful to split tracks like this manually by cities or something. I'd pull the track into earth, observe the lat/lon pairs of where I want a break, and manually insert </trkseg></trk><trk></trkseg> pairs where I wanted a break by editing the file in a text editor. You can look at the output of the above to see the result, but in general, GPX files are "just" text with some finicky punctuation and aren't THAT hard to edit. Fore example, one of the splits above that lasted slightly more than a minute would have resulted in:
<trkpt lat="45.722250000" lon="3.371190000">
<trkpt lat="45.723080000" lon="3.374230000">
<trkpt lat="45.723140000" lon="3.374650000">
I'll admit we're not a super awesome tool for "break this path into 80 km segments." While it's outside of our conversion goals, it wouldn't be unreasonable for our track filter to have something like if one of our budding devs would be interested in coding it, documenting it, and adding tests for it.
Good luck and enjoy!
On Tue, May 23, 2017 at 5:59 PM, Gilles <[hidden email]> wrote:
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Gpsbabel-misc mailing list http://www.gpsbabel.org
To unsubscribe, change list options, or see archives, visit:
Thank you very much.
|Free forum by Nabble||Edit this page|