[SOLVED] Application to split long track into 100km tracks?


To prepare a multi-day bike trip, I’d like to open a GPX file, and slice the long track it contains into 100km tracks or segments. Ideally, I’d like an app that runs on Windows, but Linux is OK too.

I tried the following, to no avail:
GpsTrackEditor, Gpx Editor: Feature not available
GpsPrune: Track > Split track into segments > Distance limits = 100km : “The track could not be split”

Does someone if any of those listed below can do the job?

Thank you.

Did you already try gpsbabel? https://www.gpsbabel.org/htmldoc-development/filter_track.html

This program can do some types of splitting http://freegeographytools.com/2009/splitting-a-gpx-track-into-smaller-files but I expect the GPSBabel ‘Split by distance’ from mmd is best for your needs.

Thanks. I tried GpsBabel in command-line mode, but the output still only contains a single track:

cd D:\GPSBabel\
gpsbabel.exe -t -i gpx -f input.gpx -x track,pack,sdistance=80k -o gpx -F output.gpx

cd D:\GPSBabel\
gpsbabel.exe -t -i gpx -f input.gpx -x track,pack,sdistance=80k,split=5m  -o gpx -F output.gpx

Did I miss something?

If you want to give it a try, here’s the zipped GPX: https://we.tl/IumTIz1kDa

Thank you.

Same result for me ???

I think the sdistance option is for something else. The doc says
“The input track will be split into several tracks if the distance between successive track points is greater than the distance given as a parameter.”

Why not split the large gpx to your dayly rides - feels more logically for me?
In Basecamp (or Mapsource) you can split a gpx-track in chunks you like. Give the dayly chunks a sensible name and export them to a separate gpx-file. Each day of your trip you can load the track you need.
If your gpx is a ‘route’, you can first convert it to a track, do the splits and if you like you can convert the splits (tracks) to routes again.
I never use ‘routes’ for my rides, but tracks and on my Edge Touring I leave TBT guidance OFF. If you choose to use routes with routing enabled, you may consider to set Recalculate to OFF - my experience is that it generates more troubles than it helps you finding your way back to the route. Problem: mostly, the original route has changed considerably and tends to point to the endpoint and not to the original route.

Edit: As an exercise I have used the external program JaVaWa RTWtool (4.2) to split your track (www.javawa.nl). Just set the split length to 100 km in Settings, specify input & output and start Convert. Result is a gpx-file containing 5 tracks, 4x 100km and 1x 46,3 km. Is this what you wanted? The file is just over 1 Mb, thus if you give me your email address in a PM I can send the result to you, but trying yourself is more ‘learning’ :slight_smile:

I have a lot of admiration for users of Basecamp, but you second option is worthy of consideration… :slight_smile:

JaVaWa RTWtool does split the file up nicely in 100km segments after choosing the right split options in the settings tab and applying the tracks modification setting, converting.
I could not get it to output separate gpx files for each segment after doing the desired splits (which is the desired outcome), though it does load the segments as separate gpx in my etrex but all named the same.

But if you submit the split gpx file that RTWTool produces into this tool http://www.gpsvisualizer.com/forerunner/ it does split the file into separate gpx files and puts them in a zip file for download.

Very nice outcome for me using these two tools.
Hope it works for you too Shohreh and thanks for asking the question as I have wanted this too.

Dank u wel ! It worked perfectly:

  1. Open file: Point to GPX file

  2. Settings > Split: Set the split length to 80 km

  3. Back in the main window, in the Tracks section, set Modification to “Split (80km)”

  4. Convert

I’m surprised none of the usual suspects support such an obvious (to me) feature. Turns out the “sdistance” switch in GpsBabel is used for something else: “input track will be split into several tracks if the distance between successive track points is greater than the distance given as a parameter.”

Maybe GpsPrune (18.6 Build 343) does support it somehow, but I couldn’t figure out why it barfs out “The track could not be split”*. No forum is available to investigate.

Actually, I don’t understand what the difference is between routes and tracks: I build… trips on a computer before copying them into my Android smartphone, and never record tracks while I’m riding.

Thanks again.

  • Track > Split track into segments > Distance limits = 80km

Just traced through gpsPrune java source. The split function also searches for pairs of points which are more than x metres
from each other. No idea where this would be useful.

With a few small changes it can do what you want. I can post a patch if wanted.


Thanks for investigating the issue. Maybe GpsPrune includes code from GpsBabel.

Since this seems like a useful feature, you might want to upload the patch to wherever the GpsPrune source code lives.