Matlab reported an error when using function gpxread() that the file is not a gpx file?

4 Ansichten (letzte 30 Tage)
I downloaded some track file in the format of GPX and tried to create a track figure with those gpx files, but matlab reported an error when executing the function of gpxread that the file is not a gpx file. The source of the gpx files is https://www.la-flamme-rouge.eu/, the gpx file is fine to be executed on a map on the website, but failed in matlab.
The gpx file is in version 1.1, with metadata tags.
The code and error is here. Need a solution:(
The gpx file is attached in a format of txt, changing the file format directly with renaming it to .gpx is available.
Need a solution:( badly:(
route = gpxread(['tokyo-2020-men-elite-itt.gpx']);
#错误使用 gpxread__ (1 )
#The file, "C:\Users\cyyyy\Downloads\gpx\tokyo-2020-men-elite-itt.gpx", is not a GPX file.
  1 Kommentar
veromora
veromora am 26 Okt. 2022
I also had the same problem, but solved it with the new function that can read those .gpx files. Since 2020 the function gpxread no longer works as it used to and you should use readgeotable instead.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Aniket
Aniket am 7 Mai 2025
I am able to reproduce the issue in MATLAB R2021a but not in R2020b.
The issue occurs because the GPX file does not specify a version or the namespace. Kindly add "version" to 2nd line of the file as shown below:
<gpx version="1.1" xmlns="http://www.topografix.com/GPX/1/1" ...>
Alternatively, as mentioned by @veromora, you may also use readgeotable function if it's a viable option.
Hope this resolves the issue!

Kategorien

Mehr zu MATLAB Report Generator finden Sie in Help Center und File Exchange

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by