Working with GPX files in ArcGIS

7932
0
03-28-2022 02:15 PM
JosephKerski
Esri Notable Contributor
1 0 7,932

GPX files, in GPS Exchange Format, are text files in XML format containing geographic information such as waypoints, tracks, and routes, as real-world coordinates.   Mapping the output from these files in ArcGIS Pro and ArcGIS Online is straightforward using the methods described in this essay. 

In a text editor, a GPX file looks like this, below.  You can see the latitude, longitude, elevation, date and time, and other information at the time I collected this particular information (when I was teaching on the campus of Oklahoma State University).

<?xml version="1.0" encoding="UTF-8"?>
<gpx
  version="1.1"
  creator="Runkeeper - http://www.runkeeper.com"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="http://www.topografix.com/GPX/1/1"
  xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"
  xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v1">
<trk>
  <name><![CDATA[Walking 2/16/17 3:53 pm]]></name>
  <time>2017-02-16T15:53:36Z</time>
<trkseg>
<trkpt lat="36.119991000" lon="-97.069730000"><ele>280.0</ele><time>2017-02-16T15:53:36Z</time></trkpt>
<trkpt lat="36.120041000" lon="-97.069666000"><ele>280.0</ele><time>2017-02-16T15:53:44Z</time></trkpt>
<trkpt lat="36.120077000" lon="-97.069520000"><ele>280.0</ele><time>2017-02-16T15:53:46Z</time></trkpt>
<trkpt lat="36.120056000" lon="-97.069406000"><ele>280.0</ele><time>2017-02-16T15:53:49Z</time></trkpt>
<trkpt lat="36.120141000" lon="-97.069311000"><ele>280.0</ele><time>2017-02-16T15:53:51Z</time></trkpt>
<trkpt lat="36.120208000" lon="-97.069230000"><ele>280.0</ele><time>2017-02-16T15:53:53Z</time></trkpt>

Sample GPX file.  The actual GPX file contains hundreds more GPS points as latitude-longitude values, each coordinate pair occupying one line in the data file.

Fifteen years ago, GPX files were one of the few types of files that were mappable.  I used them extensively in the many geocaching courses that I created in city parks, riparian zones, field lab sites, and elsewhere for years to foster spatial thinking.  Much has changed over that time:  Educators and students now have a myriad of types of files and objects in those files to map--points, lines, polygons, grids, images, and more. 

Why bother with GPX files today?  First, comparing raw GPX files to mapped GPX files is a simple, clear way to explain why mapping adds value.  Second, these files are still sometimes the only output from GPS receivers, GPS phone apps, fitness apps, or other mapping tools.   As such, they are sometimes the only way you can map that data that you have collected from your fieldwork with students, from your geocaching course, or from your hike or cycle ride.   Third, GPX files are still wonderfully easy-to-use sets of information to quickly map where you have been, and when symbolized and classified, and overlaid with other data, can help us ask the "whys of where" questions about patterns, relationships, and trends in those locations.

To use GPX files in ArcGIS Online:  Go to Classic viewer > Add GPX from a file > save layer > Publish as a hosted feature layer and share it with public as well. See the image below featuring one of my Redlands walks on a work trip.  (2) You could also use the online tool in the following link to convert GPX to SHP and > then in your Content zone in ArcGIS Online > add content from the resulting zipped SHP file.  See image belowHere is the GPX to SHP tool:  https://mygeodata.cloud/converter/gpx-to-shp   The free version currently only lets you convert 2 files per day.   At some point in the future, you will also be able to add GPX files into the new map viewer in ArcGIS Online, as well. 

For ArcGIS Pro:  Use the GPX to Features tool > do your symbology, classification, and analysis in ArcGIS Pro.  When done, you could publish your resulting layer to ArcGIS Online and share it.   You can also bring the output from your GPX mapping from ArcGIS Online into Pro for advanced analysis.  You can also convert from shapefile to GPX, if you'd like, and then you could load that GPX file into an app or into a GPS receiver to follow it.

When done with either the ArcGIS Online or ArcGIS Pro methods, you could create a web mapping application such as an Instant App or a story map from the data.   You could even create a 3D scene as I did in the example below.  You could also use the results as part of an ArcGIS Dashboard!

JosephKerski_2-1648500353372.png

I use the above map, which you can interact with in ArcGIS Online, here, in courses and workshops where we discuss accuracy and precision.  Students compare the elevation and the x-y position of my recorded tracks from a GPS unit to a GPS app on my smartphone. Both methods of recording my track were derived from GPX files. I also used GPX files in my points in Salzburg Austria map and in my underwater spatial accuracy test in Hamburg, Germany.

JosephKerski_0-1648500268804.jpeg

Mapping the output from a GPX file of one of my walks in Redlands, California.   Admittedly boring but simple and effective way of teaching spatial thinking.  On a very simple level, you could compare the GPX file as I showed above to the map of the GPX file, discussing how much more information you can gain from mapping things.  You could symbolize on velocity, time, or if you had collected attributes along those lines or points, water quality, weather, traffic volume, litter, or anything else.  

JosephKerski_3-1648500973278.png

Notice the improvement in spatial accuracy for the above GPX tracks collected using the same smartphone app over the span of 4 years, as I describe here.

JosephKerski_4-1648501378553.png

A 3D scene in ArcGIS Online showing the results of my experiment, with elevations in meters above sea level shown as labels (but remember that some of them are underwater) and symbolized as cylinders.   Feel free to open and interact with this 3D scene!

I look forward to your comments to these methods described and also hear about how you use and map GPX files. 

Tags (4)
About the Author
I believe that spatial thinking can transform education and society through the application of Geographic Information Systems for instruction, research, administration, and policy. I hold 3 degrees in Geography, have served at NOAA, the US Census Bureau, and USGS as a cartographer and geographer, and teach a variety of F2F (Face to Face) (including T3G) and online courses. I have authored a variety of books and textbooks about the environment, STEM, GIS, and education. These include "Interpreting Our World", "Essentials of the Environment", "Tribal GIS", "The GIS Guide to Public Domain Data", "International Perspectives on Teaching and Learning with GIS In Secondary Education", "Spatial Mathematics" and others. I write for 2 blogs, 2 monthly podcasts, and a variety of journals, and have created over 5,000 videos on the Our Earth YouTube channel. Yet, as time passes, the more I realize my own limitations and that this is a lifelong learning endeavor and thus I actively seek mentors and collaborators.