How to create maps using GPX files
In this article, you'll learn how to use GPX files (and other spatial files) of your favorite bike routes and hiking trails from apps like Komoot or Strava, to create beautiful maps in Datawrapper.
By the end of this article, you'll be able to easily create a map like below in a few minutes! (hover over the map and click on "edit this chart" to play around with it yourself! )
We'll be using Datawrapper locator maps, so if you're not familiar with this map type, head on over to this article " How to create a locator map" to learn more. You can also click here to create one yourself while following along this tutorial.
- Download the route's GPS data as GPX file:
- Most routing apps offer options to download your route as a GPX file. If there are no options for GPX, you can also export the data as TCX, KML or other spatial files that are available.
- Convert GPX file into a GeoJSON file:
- There are multiple tools to do this. In this example, we'll use geojson.io which is a free online tool to edit map data. Upload the GPX file into geojson.io and click on Save > GeoJSON:
You can also use GQIS to convert spatial files into GeoJSON or Ogre, a web client for ogr2ogr command line tool, which supports many file format transformations.
* If the GeoJSON file is too detailed, the route might not render nicely on the map. If that's the case, we recommend simplifying it in mapshaper before exporting. You can do this either by by typing in
-simplify 5% keep-shapein the console or following steps mentioned in this article.
- Upload the GeoJSON file into Datawrapper locator map:
- Go to Step 1 in Datawrapper and click on "Import line and area markers" and upload the GeoJSON file or drop/paste the code into the textfield.
- Customize your map and add annotations
- The great thing about Datawrapper locator map is that you can customize color and lines for each section of the routes easily. You can even insert markers, tooltips and images to add more descriptive details.
That's it! To learn more about
customizing your locator map, head over to
our academy articles here. You can also see some
example maps in our "
Examples of locator maps".
We also wrote some blog posts on maps with routes:
- Of merchants and pilgrims : cities visited by Ibn-e-Battuta and Marco Polo
- Which EuroVelo bike route is the hardest to bike? : a map of all eurovelo bike routes
- How 538 reindeer traveled from Norway to Alaska in 1898
- Fast trains, fast map? a map of China's High-Speed Railway
- Three jobs of a callout line: Map of Berlin's subway