Read GPX file
Read all track points and waypoints and put them into arrays
INPUT:
- GPX file name (and path)
PROCESS:
- Convert XML to DOM data
- Track points: Extract latitude, longitude, elevation and time
- Way points: Extract latitude, longitude, elevation, time and name
OUTPUT:
- Track points: double array [latitude, longitude, elevation] and cell vector {time}
- Way points: double array [latitude, longitude, elevation] and cell array {time, name}
If an elevation is not present, this elevation is set to zero.
If a time or name is not present, this time or name is set to empty.
If any lat, lon, elev. is not a number, 'CORRUPT GPX FILE!' is returned for the first way point name.
Write GPX file
Function to write a GPX file with given track and way points.
INPUT: DataGPX, a struct with the fields:
- fileName: string, default 'MyGPX' + date
- header: string with header information, default: 'version="1.1" xmlns="http://www.topografix.com/GPX/1/1"'
- wpts: lat, lon, ele, double nwpt x 3 or nwpt x 2, nwpt is number of way points, default: no way points
- default for elevation: 0
- wptTime: time of a way point, cell array nwpt x 1, default: no way point time
- wptName: name of a way point, cell array nwpt x 1, default: no way point name
- trkName: name of total track, string, default: file name
- trkPts: lat, lon, (ele), double ntrk x 3 or ntrk x 2, ntrk is number of track points, default: no track points
- default for elevation: 0
- trkTime: time of a trk point, cell array ntrk x 1, default: no track time
All fields are optional
A demo file is included
인용 양식
Peter Seibold (2024). Read GPX file and write GPX file (https://www.mathworks.com/matlabcentral/fileexchange/171459-read-gpx-file-and-write-gpx-file), MATLAB Central File Exchange. 검색 날짜: .
MATLAB 릴리스 호환 정보
개발 환경:
R2020a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux태그
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!버전 | 게시됨 | 릴리스 정보 | |
---|---|---|---|
1.0.0 |