Splitting long track into 80km segments?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Splitting long track into 80km segments?

Gilles
Hello

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:
https://we.tl/m0dWOAG7X0

Does GpsBabel support splitting tracks into smaller segments?

Thank you.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Splitting long track into 80km segments?

Robert Lipe-4
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
      88

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">
        <ele>0.000000</ele>
        <time>2017-05-22T21:06:27.780Z</time>
      </trkpt>
    </trkseg>
  </trk>
  <trk>
    <name>20170522210728</name>
    <trkseg>
      <trkpt lat="45.723080000" lon="3.374230000">
        <ele>0.000000</ele>
        <time>2017-05-22T21:07:28.550Z</time>
      </trkpt>
      <trkpt lat="45.723140000" lon="3.374650000">
        <ele>0.000000</ele>
        <time>2017-05-22T21:07:36.530Z</time>
      </trkpt>


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!
RJL


On Tue, May 23, 2017 at 5:59 PM, Gilles <[hidden email]> wrote:
Hello

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:
https://we.tl/m0dWOAG7X0

Does GpsBabel support splitting tracks into smaller segments?

Thank you.



--
View this message in context: http://gpsbabel.2324879.n4.nabble.com/Splitting-long-track-into-80km-segments-tp12263.html
Sent from the GPSBabel - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
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
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc


------------------------------------------------------------------------------
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
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Splitting long track into 80km segments?

Gilles
Robert Lipe-4 wrote
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.
Thank you very much.
Loading...