Record GPX files with Apple Watch

Many people have the habit of exercising outdoors. Track records, like photos and videos, are also a way to record their daily lives. Public venues, such as an outdoor hiking or cycling route, can actually be shared openly. To record the movement track, Apple Watch is a good choice. It can export GPX files, play back the movement route, and also facilitate communication with people who have the same hobby. Later, people can get the GPX file and follow them to play. I did a special test last weekend, and the process is recorded as follows.

First of all, after going out, you need to open the "Physical Training" App on your Apple Watch. The icon is a running little green man. Choose your own exercise type, and the lazy person will open it when you go out and close it when you go home (for fear of revealing your family's residential address, You can turn it on outdoors far away from your residence. In fact, you can also manually delete the corresponding GPS source file, which will be introduced later in the article), detailed official tutorial link .

workout

After completion, click the end button on the watch, we need to export the GPX file, the operation method is: iPhone Health App --> Click the avatar in the upper right corner of the App --> Slide to the bottom, there is "Export All Health Data" --> After waiting for a period of time, choose the appropriate method to transfer it to the computer. The export file is a zip archive. After decompression, the GPX file is in the workspace-routes directory. Here is an introduction to the GPX file, the Apple Watch example is as follows (manually deleted many lines of track files):

 1    <?xml version="1.0" encoding="UTF-8"?>
 2    <gpx version="1.1" creator="Apple Health Export" xmlns="http://www.topografix.com/GPX/1/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
 3        <metadata>
 4            <time>2022-10-17T02:58:29Z</time>
 5        </metadata>
 6        <trk>
 7            <name>Route 2022-10-16 7:44pm</name>
 8            <trkseg>
 9                <trkpt lon="121.421714" lat="31.237364"><ele>5.816855</ele><time>2022-10-16T11:09:01Z</time><extensions><speed>1.103302</speed><course>345.958534</course><hAcc>2.456533</hAcc><vAcc>1.740192</vAcc></extensions></trkpt>
10                <trkpt lon="121.421711" lat="31.237374"><ele>5.753454</ele><time>2022-10-16T11:09:02Z</time><extensions><speed>1.105864</speed><course>344.349006</course><hAcc>2.457487</hAcc><vAcc>1.740195</vAcc></extensions></trkpt>
11                <trkpt lon="121.421708" lat="31.237384"><ele>5.688401</ele><time>2022-10-16T11:09:03Z</time><extensions><speed>1.107045</speed><course>342.944736</course><hAcc>2.458398</hAcc><vAcc>1.740198</vAcc></extensions></trkpt>
12                <trkpt lon="121.421704" lat="31.237393"><ele>5.622375</ele><time>2022-10-16T11:09:04Z</time><extensions><speed>1.108006</speed><course>341.729072</course><hAcc>2.459224</hAcc><vAcc>1.740203</vAcc></extensions></trkpt>
13                <trkpt lon="121.421700" lat="31.237403"><ele>5.555466</ele><time>2022-10-16T11:09:05Z</time><extensions><speed>1.106729</speed><course>340.763179</course><hAcc>2.459913</hAcc><vAcc>1.740207</vAcc></extensions></trkpt>
14                <trkpt lon="121.421697" lat="31.237412"><ele>5.486942</ele><time>2022-10-16T11:09:06Z</time><extensions><speed>1.104133</speed><course>339.990078</course><hAcc>2.460460</hAcc><vAcc>1.740212</vAcc></extensions></trkpt>
15                <trkpt lon="121.421693" lat="31.237422"><ele>5.417754</ele><time>2022-10-16T11:09:07Z</time><extensions><speed>1.099726</speed><course>339.540531</course><hAcc>2.460840</hAcc><vAcc>1.740217</vAcc></extensions></trkpt>
16                <trkpt lon="121.421689" lat="31.237431"><ele>5.347829</ele><time>2022-10-16T11:09:08Z</time><extensions><speed>1.093210</speed><course>339.310512</course><hAcc>2.461093</hAcc><vAcc>1.740221</vAcc></extensions></trkpt>
17            </trkseg>
18        </trk>
19    </gpx>

GPX (GPS Exchange Format) is an XML format file, a general GPS data format designed for application software, labels save location, altitude and time, can be used to exchange data between different GPS devices and software, GPX The points in the file must contain at least two pieces of information of latitude and longitude coordinates, and other fields are optional. From the original file above, the watch records a point per second, which in turn includes latitude and longitude, altitude, UTC time, speed, course (seems to mean heading https://en.wikipedia.org/wiki/Course ), hAcc (Horizontal accuracy estimate horizontal accuracy estimate [mm]), vAcc (Vertical accuracy estimate vertical accuracy estimate [mm]), the following data labels are concepts in navigation.

With this GPX file, the analysis can be viewed with GPXSee , a cross-platform software. GPXSee supports major GPS log file formats such as GPX, TCX, KML, FIT, IGC, NMEA, GPI, LOC, SLF, SML and OziExplorer etc.

GPXSee

Hold down the left mouse button and drag the altitude or speed below. There is a red punctuation on the track graph that will move according to the track, which can show when and where it is. It is similar to playing a video animation. It is estimated that the video of people running on the map can also be done in this way, and it can also be printed and exported as PNG images and PDF files.

The Geo Data Viewer plugin in vscode can also view:

Geo Data Viewer

You can choose to view the satellite map in 3D mode, which is still relatively clear:

Geo Data Viewer 3D

In addition, Google Earth also be support gpx file, there are introductions on the Internet. https://hiking.biji.co/index.php?q=trail&act=gpx_list This Taiwanese website has a gpx share list.

Lastmod: Monday, August 28, 2023

Translations: