How to write data back to a GPX file

Hey all,
I can load a GPX file just fine. I've modified the lat and lon data and now I want to save this back to a GPX file but I can't seem to find the complimentary script to gpxread. Any suggestions?
Thanks! Trevor

7 Comments

Look at the format of the file you started with and write it back in that format. You can check the gpxread function to see if you can borrow some code. The few times I looked at a gpx file it didn't seem to be that complex. I'm planning on writing something like this in a few weeks, so if you can't solve it on your own, just put a comment here and I'll post my script.
The output is a simple structure, but how it parses this info is a little more complex than I was expecting. There's a document class that I'm just now learning about after stepping through the gpx file... I'll keep digging and see what I can find. I'll post any progress here and I'd appreciate your findings as well. Thanks!
Curious if you ever managed to code a 'gpxwrite' function (mathworks has gpxread, but not gpxwrite - seems odd they don't)? I'd be interested in a copy if you did.
Thanks!
Bruce
The documentation for gpxread links to the GPX 1.1 Schema Documentation, as it claim to be fully compliant with that. That should give you a firm foothold to start.
It turned out the implementation I needed a gpxwrite for didn't even work on a conceptual level, so I never wrote it.
Rik,
Can you explain what you mean by your last sentence? Like Bruce, I am interested in a MATLAB gpxwrite function.
Thanks,
Nina
What that sentence means is that I had an idea/project. That project required gpxwrite as one of the steps. However, when I tried to implement the idea/project, it turned out that it wouldn't work, even with a correct implementation of gpxwrite. The upshot is that I never wrote it.
But as I wrote in that comment, there is a description of the standard, so you can implement it yourself if you want to.

Sign in to comment.

Answers (0)

Categories

Tags

Asked:

on 31 Jul 2018

Commented:

on 14 Sep 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!