Matlab reported an error when using function gpxread() that the file is not a gpx file?
조회 수: 5 (최근 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!