GPX splitter util

Posted on
  • Don't know exactly where to post this, here seems appropriate.

    GPX splitter - a tool for splitting GPX route files into several separate files, based either on the number of track points or distance.

    Was plotting the route for a tour a few months back, & was doing it the way I normally do by planning the whole thing as one big route. I generally find this easiest as I don't plan where we'll stay at any particular night in the first drafts, & if I do, then it's a right pain to make subsequent days match up correctly, especially when you're looking at the map of an unfamiliar place.

    The main negative I find with the one big route approach is that on my bike computer (Wahoo Elemnt Bolt), it struggles with larger files & you lose a bit of the sense of scale on the elevation page. What might be a significant (but smaller) rise can be dwarfed by an upcoming mountain which perhaps is to be tackled in a few days time.

    Komoot does provide tooling to break routes down into days with a nice UI, but you have to pay for that, & being a software engineer who knew that GPX files were just XML, I figured I could just do it myself. Wrote a little script before the holiday to break down our big route into ten sections & it worked out well for our trip. Had a few quiet hours on a Friday afternoon & figured I'd make it a GUI so ended up with this little util.

    It's quite hacked together (I'm generally more BE-focused) & only tested manually with GPX files from Strava & Komoot, so it's likely not perfect. Any feedback - be it issues, UI suggestions or features - is welcome! I've used loads of random utils for GPX stuff on the web over the years so nice to be able to contribute something back.

    Things I'd like to do:

    • Add option for splitting by certain length.
    • Add an interpolated track point when splitting to get more evenly-sized split files.
    • Possibly handle TCX files so can do routes with waypoints also.

    1 Attachment

    • Screenshot 2024-05-31 at 09.32.11.png
  • Ah cool. Will try this out. Been looking for a better way of splitting routes than cycle.travel offers. Cheers.

  • I’ve been looking for something like this!
    Thanks
    Will give it a go

  • I used this for my trip last week and it was perfect. Thanks!

  • Ah great to hear! Glad it's of use to someone other than me :)

  • This is awesome! If you'd be happy for contributors I wouldn't mind helping with any feature requests/bugs?

  • Sound good, and a very interesting possible way to bypass one of the main things I use RidewithGPS for.

    A suggestion / request, said in complete ignorance of how hard this would be to do, would be to also allow splitting at a visual point on the track shown on a map - is that possible using Openstreetmap (or other)?

  • Cheers, & sure thing! Code isn't the neatest setup at the moment, mind - & build/dev process is a little shonky as I wanted to avoid using a huge framework for a small project.

  • It's a decent suggestion & something I did consider earlier, but was put off by how hard it sounded. Turns out it's pretty simple to use OSM with some libs. Started some work on plotting the route on a map, will see how I can fit that into the splitting utils (showing current splits, allowing for editing on the map perhaps).

  • Understood - I'm not at all surprised it's complicated, I'm amazed by anyone who can do anything even remotely along these lines! Sounds very interesting, will keep an eye on this to see developments!

  • Quite enjoyed this little project, so completely rewrote it over the last few days & improved the flow of things a little.

    Also worked a bit more on the map plotting & released that. It could do with some improvements still, but it's a decent start so good enough for publishing. I apologise that the colour palettes for routes & their parts is pretty horrendous as it's currently just using an RNG for RGB. I'm colourblind so even my example image here is quite difficult for me to see.

    Would like to support a way of fine tuning the length of each segment, since the main reason for building this tool was to be able to split big tours down into multiple days. Been mulling over a few ideas for UX for that & not arrived at anything which feels quite right yet, so will continue to have a think.


    1 Attachment

    • Screenshot 2024-08-12 at 19.55.36.png
  • Just tested it, works perfectly as far as I can see. Couple of suggestions -

    1. a download all option, and
    2. the map highlighting which split section you're about to download when you hover over the download button.

    Suspect first might be simpler than the second, but reckon both would be handy additions. :)

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

GPX splitter util

Posted by Avatar for GideonPARANOID @GideonPARANOID

Actions