Matlab reported an error when using function gpxread() that the file is not a gpx file?
4 次查看(过去 30 天)
显示 更早的评论
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 个评论
veromora
2022-10-26
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.
回答(1 个)
Aniket
2025-5-7
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!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 MATLAB Report Generator 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!