Using GPX & KML files for hiking

If you actively plan your hikes using web-based apps or desktop software, no doubt you’ll already know what a GPX or KML file is. If you are new to hiking, this is something you will eventually come across when planning your next adventure. I always work with GPX files when planning or recording my hikes and GPX files are what you can download from this site. I rarely work with KML files and there’s a few reason why.

What’s the difference between GPX and KML?

The GPX format is an XML data format designed for lossless storage and transfer of data for GPS devices or mobile navigation apps. A GPX file can contain a vast array of very detailed data (such as GPS signal strength, number of visible satellites, waypoints, routes, tracks, time and speed). The format is available publicly from Topographix and is extensible by using a special extension keyword in its XML. It is used by programs that can match GPS data to events (such as geocoding photos) and is the best choice when you need to move data between GPS devices or when you have needs other than presentation. The format has explicit formats for Routes, Waypoints, and Tracks as distinct data types.

The KML format is a presentation language which was designed for annotating maps. It was originally defined by Keyhole (now Google) and is now a an Open Geospatial Consortium (OGC) standards. KML files can carry global position data and references to other files (typically graphics files) in a text based format. For example, a KML file on its own could contain a set of waypoints but not an associated map image. Any map image would be on a separate file. A Keyhole Markup Zip, KMZ, file is a zipped (using the conventional zip protocol) compilation of a KML file and any associated files. The zipping and unzipping processes are generally performed by the application programs and are transparent to the user. KMZ files can be displayed in Google Earth Pro and loaded into some map-capable GPS units.

How to choose?

Which file format you use is dependent upon what you’re trying to do. For people who are looking to preserve the maximum amount of data, a GPX file will work best, as this format will contain all the information that was recorded and downloaded from your device.

If you only need the tracks for Google Earth, then you can work with a KML file. If you have any doubt, you can always create or export both GPX and the KML. If you have one file type, but need the other, there are online converters you can easily use.

Waypoints, tracks, and routes

Waypoints, tracks, and routes

A GPX file is generally used to describe waypoints, tracks, and routes. Location data (and optionally elevation, time, and other information) is stored in tags and can be interchanged between GPS devices and software. Common software applications for the data include viewing tracks projected onto various map sources, annotating maps, and geotagging photographs based on the time they were taken. The minimum properties for a GPX file are latitude and longitude for every single point. All other elements are optional.

A waypoint is an individual point among a collection of points with no sequential relationship. It consists of the WGS 84 (GPS) coordinates of a point and possibly other descriptive information.

A route is an ordered list of routepoints (waypoints representing a series of significant turn or stage points) leading to a destination. A route is made of routepoints between which a program must get the corresponding track from a vector map to draw it. The routepoints may be river crossings or trail junctions or as distant as a campsite.

A track is made of at least one segment containing waypoints, that is, an ordered list of points describing a path. A Track Segment holds a list of Track Points which are logically connected in order. To represent a single GPS track where GPS reception was lost, or the GPS receiver was turned off, start a new Track Segment for each continuous span of track data. A track is made of a sufficient number of trackpoints to precisely draw every bend of a path. It is the raw output of, for example, a GPS recording the course of your hike, or the rearrangement of such points to remove excess ones, or data from any source such as extracted from a vector map. Think of tracks as detailed breadcrumb trails between point A and point B, a route is simply point A and point B, without any information in between.

Conceptually, tracks are a record of where you have been and routes are suggestions about where you might go. For example, each point in a track may have a timestamp (because you recorded where and when you were there), but the points in a route are unlikely to have timestamps (other than estimated trip duration) because route is a suggestion which might never have been traveled.

Creating or Editing GPX files

Creating or Editing GPX files

Everyone has different preferences and workflow, and there are literally dozens of web apps and software that allow you to edit and convert GPX files. I have listed a couple below that I have played with in the past. Have a play around with different tools and see what works best for you.

  • Text Editor – You can open the raw XML data of a GPX file and update it using any text editor. On a Mac, there’s the standard TextEdit, and on Windows there’s Notepad or Wordpad. You can also open a GPX file with a word processor like Word or Google Docs; just remember to save it as a text file. On the PC, I prefer Notepad++ which is free source code editor and Notepad replacement.
  • GPX Studio – Is a free online GPX viewer and editor that allows you to do a range of things including creating, visualising, editing, reversing, automatically add elevation data, merge multiple tracks, extract segments and download your completed GPX file.
  • Garmin Basecamp – You don’t need a Garmin GPS to use Basecamp, it will work with any GPX file. And while there are aspects that are clunky, it allows you to easily plot waypoints, create tracks, and create routes. You can also do things like split, reverse, and join tracks. Basecamp doesn’t come with any useful maps but you can easily install free OSM maps to work with. If you have a Garmin GPS unit, you can plug it into the computer and transfer GPX data back and forth. And if you have a Garmin GPS with maps, you’ll be able to see them (and plan with them) in Basecamp if you plug the unit in.
  • CalTopo Website – CalTopo allows you to select from tons of map layers and create tracks, routes and waypoints and then export them as a GPX file. I don’t find this as user friendly as GPX Studio though.
  • GaiaGPS Website and Apps – Is another site similar to CalTopo with a cleaner interface that’s a bit more user-friendly. You can create GPX routes and waypoints and export to your computer or the Gaia GPS app(s). While the core use is free, there are premium memberships available.
  • GPSVisualizer Website – This website has heaps of useful tools for both KML and GPX files, including adding elevations and file conversion. It’s free and easy to use, yet powerful and extremely customisable. I use this mostly for converting KML to GPX or for adding elevation data to GPX files.
  • Google Earth – Load your GPX tracks in here and then pan around in 3D. It’s a great way to understand the elevation profile while interacting with the GPX file. I don’t use this often but it is nice at times to get a better feel for the route you have planned.
  • Garmin Connect Website and Apps – If you own a Garmin smartwatch and want to create routes or courses and transfer to watch, try the Garmin Connect Course Planner. It’s also free.

Hope this information helps. If you’re keen to get your hands on GPX files to help you navigate your next hike, check out the hikes on this site. I am working towards adding a GPX file for every trail so if you have a GPX file that isn’t here, feel free to upload it.

Leave a comment