Python Forum
[GPX] Read all trkpt, and merge into single track? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: [GPX] Read all trkpt, and merge into single track? (/thread-24091.html)



[GPX] Read all trkpt, and merge into single track? - Winfried - Jan-30-2020

Hello,

I need to merge multiple tracks in multiple GPX files that all go in the same direction but aren't in the right order.

Before I figure out how to do it, I was wondering if someone has working code to…
  1. Read multiple GPX files, each containing one or more tracks (<trk>),
  2. Read all the track points they contain (<trkpt>),
  3. Order them, and
  4. Save the whole thing into a single track in a single GPX
?

Thank you.