How to import a .GPX file without using GPXread?

23 views (last 30 days)
For context, i have 1 large gpx file that needs to imported so i can create graphs from the co-ords.
However, gpx read is not allowed in my case.
I am thinking about using low level i/o functions to get started?
I know my file is quite large and is going to need while loops to read all the data.
Below is the code i've got so far, which is far from where i need to be.
Any help is appreciated!
filename = input('Open file: ', 's');
[fileID, errmsg]= fopen(filename);
if (fileID==-1)
disp(errmsg)
end
Thanks!
  3 Comments
Sarah
Sarah on 9 Oct 2022
So this is for an in-class task, where the teacher uploads their own gpx file and looks at how we coded our way around gpxread. I've uploaded an example .txt file to look at. My only problem at the moment is uploading a gpx file without gpxread.
Star Strider
Star Strider on 9 Oct 2022
O.K., since it’s a homework problem, the only suggestions I have is that it appears to be an .xml file or something similar. The regexp function could be an option, however in my experience that can be a bit of a challenge to get to work correctly, although it can perform miracles. It might be necessary to have several calls to it in order to extract the information you want (that I assume are the geospacial coordinates and time). See the See Also section for additional links.

Sign in to comment.

Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!