logo
SUPPORT

mapping

How to add trails to OSM

Markus
2023-11-09
Machine translated

If you haven't already read the general overview of OpenStreetMap mapping as background, read this article first. This piece follows on from it, describing step by step and in more detail how to add trails to the OSM database and how to edit them.

This piece is fairly long, because every step needed is described in detail so that you don't have to guess or fall back on other guides. The steps themselves are relatively simple, though, and it's worth setting aside 30–90 minutes for your first go, depending on how familiar the subject (maps, GPS and so on) already is to you. Once you've got the first round of learning and practice out of the way, actual mapping sessions are typically only a few minutes long.

The easiest way to learn OpenStreetMap mapping is to practise editing in OSM's map editor while you read this article. You can make edits completely freely and safely for practice, as long as you don't go and save anything. Before saving, OSM does ask clearly "are you sure you want to save these changes", so it's hard to do any damage by accident.

This article was originally written from a mountain biker's point of view. The workflow is exactly the same for a trail runner or a hiker, though. Before classifying trails, it's worth reading this piece, which describes classifying trails from the point of view of someone travelling on foot.

Do these preparations before you start mapping

The following steps only need to be done once, so that you can start taking part in the mapping effort.

Create a user account on the Openstreetmap.org map service:

  1. Open https://www.openstreetmap.org in a web browser
  2. Choose "Sign Up" in the top right corner of the page
  3. Fill in the details for your user account and choose "Sign Up" below
  4. You'll get a confirmation by email, and once you've followed its instructions you'll have a user account created on the OSM service
  5. Sign in on the same OSM page, https://www.openstreetmap.org, if it didn't already happen automatically

The "Sign Up" button in the top right corner of the page for creating a user accountThe "Sign Up" button in the top right corner of the page for creating a user account

Using Strava simplifies the mapping workflow described later, but it isn't necessary in any way. Many mountain bikers and trail runners already have a Strava account, because it's an easy way to see where your friends have ridden and to learn new trails and routes that way too. You can get started with Strava by signing up at https://www.strava.com.

A Garmin, Suunto, Polar or a smartphone with a suitable app (Strava, OruxMaps etc.) lets you record a GPS track of your ride. On the Garmin and Suunto web services at least, you can also switch on automatic transfer of your workouts / rides to Strava, from where they're then available for the Strava-based workflow.

After every ride, check whether the trails are already in OSM and classified

After every ride it's easy to look in Trailmap at which trails you rode and, above all, whether they're already marked in the OSM map data and whether they also have the appropriate classification, i.e. the mtb:scale tag. If you spot gaps, they're easy to mark or fix in the OSM map data right away, while your ride is still fresh in your mind.

Checking that the OSM map data is up to date and complete after a ride:

  1. Open the Trailmap app in a web browser: https://trailmap.fi/.
  2. Open the track you rode in the app. You can do this either via Strava or by loading the GPX track (the file format for GPS tracks) straight from your computer / device.
  1. Now you can check whether the trails are marked along the whole length of the route you rode, and whether they're colour-coded correctly (i.e. whether they have an mtb:scale tag at all, and if so, whether the tag is the right one to reflect the trail's difficulty). The "Hide" button at the top of the Trailmap app makes checking easier: it dims the route line (and a second press restores it), so the map underneath shows better.
  2. If you spot gaps, see below for how to add to or fix the OSM map data.

Think before you add to or edit the OSM map data

Before adding to or editing the OSM map data, take a moment to consider what you're doing and whether you have solid enough grounds for the additions or changes you're planning. A little thought is a good thing, so that the quality of this shared map data stays good and the volunteer effort doesn't lead to a situation where one person's changes get corrected in the other direction by another user soon after, and so on.

Before you start adding new trails or editing trails for the first time, it's a good idea to look at an area you know well and see how the trails already in OSM are described: how they're drawn, how they connect to each other and what tags they have. It's worth looking at at least 5–10 different trails so you get a good picture of the typical ways of describing trails. Copying from others is the easiest way to learn to use OSM correctly.

You're adding a missing trail:

You're adding a missing mtb:scale tag or other necessary tags:

You're editing an existing trail, or its mtb:scale or other tags:

Add to or edit the OSM map data

There are many different tools for adding to and editing OSM map data. Below is one of the simplest ways, granted that for a power user it isn't necessarily the most efficient way when you're making a lot of edits and additions to the OSM map data. A power user should consider getting to know the JOSM editor, for example.

Open the OSM map editor straight from the Trailmap app (the easiest and fastest way):

  1. Open your track in the Trailmap app following the instructions above ("Checking that the OSM map data is up to date and complete after a ride").
  2. You can already centre the map on the spot where you want to add to and edit the OSM map data, and zoom the map to a level where you can see the track in detail.
  3. The first time you use it, go to User Settings (once you're signed in, the face-icon button) and switch on the "OSM mapper" feature there.
  4. Open the OSM mapping page in the Trailmap app from the top menu, or on a phone from the "..." menu in the bottom menu.
  5. Choose "Open iD editor" on the page, and the OSM map editor opens in your browser at exactly the same spot and the same zoom level as in the Trailmap app. The track is also visible in the OSM map editor, making it easier to add to or edit the OSM data. Note: if you haven't visited the OSM map editor before, it may ask for your user account and password before it opens: enter them, and you can also choose "remember me" to speed things up next time.

OR

Open the OSM map editor in a web browser:

  1. Save your GPS track in the GPX file format, following the instructions above.
  2. Open https://www.openstreetmap.org in a web browser.
  3. In the top left corner, under the "Edit" button, choose "Edit with iD".
  4. On the page that opens, sign in to your OSM user account, if it doesn't happen automatically.
  5. The screen opens in the OSM editor's "iD" editing mode, which by default shows a satellite image as the base map.
  6. If you like, change the base map to something else, for example the OpenStreetMap Standard one: in the toolbar on the right-hand side of the page, choose "Background settings", or open it directly by pressing the "B" key on your keyboard. Choose the base map you want from the Backgrounds menu and close the menu.
  7. Drag and drop the GPX file you saved earlier onto the base map open in your web browser, using Finder on a Mac or File Explorer on Windows: the GPS route appears on the map as a red line. You can show several different GPS routes at the same time in the same way.
  8. The GPS track on the map helps you draw the new trails you want to add, or select the trails whose tags you want to edit.

Now that the OSM map editor is open, you can add or edit trails and their details with the following instructions:

Add a trail:

  1. Choose "Line" at the top of the map, or press "2" on the keyboard, after which you can start drawing the trail.
  2. Choose the trail's start point carefully (the first click of the mouse cursor marks the start point): trails usually start from other trails, roads or other paths. When you choose the start point so that the other trail / path is "pre-selected" under the cursor (it has a red outline around it when the cursor is over it, before you've pressed the mouse button), the new trail you're drawing starts from that path, which is important for apps' routing features.
  3. Once you've set the start point, you can draw the trail on the map with the mouse, using as a guide the GPS track you dragged and dropped onto the base map earlier.
  4. You can finish drawing the trail with the Enter key. As with choosing the start point, the end point needs to be chosen carefully if the trail connects to another trail, road or other path.
  5. With Undo (the icon at the top of the map, or from the keyboard) you can fix the trail's lines if you didn't get them right straight away, or even delete the whole trail if you want to start again.
  6. Once you've finished drawing the trail with the Enter key, the trail is left flashing on the screen. Next you need to edit the tags on the left-hand side of the screen to suit; see the instructions for that below.

The iD editor's buttons at the top of the mapThe iD editor's buttons at the top of the map

Edit a trail's tags:

  1. If you didn't draw the trail yourself following the instructions above, select an existing trail by clicking it with the mouse cursor until it flashes slowly.

  2. On the left-hand side of the screen you can now see all the tags attached to the trail. This is OSM's way of describing what kind of trail or path it is. There's a very large number of possible tags, but for editing trails you only need to know a few of the most important ones. The easiest way to learn tags is to select trails and other paths you know well and look at what tags have been attached to them.

    Note: on the list on the left-hand side of the screen, the tags are in a sense there twice: first, at the top, the most important tags in fields of their own, e.g. "Width", and then further down the "Tags" list shows all the tags given to the element — so if you've entered something in the Width field above, it also shows on the "Tags" list. Likewise the trail's type, e.g. "Path" chosen above, shows further down as "highway=path".

  3. A typical small forest trail is of the type (the "feature type") "Path". If you've made a new trail, choose "Path features" on the left first, and "Path" under that.

  4. You can look up other more common path types and tags here: Definitions of trail tags.

  5. Allowed Access: it's worth making sure that the "yes" entries match what the trail is meant for.

  6. Open "All tags" at the very bottom, if it isn't already open. Under it, in the case of a trail, there should already be the tag "highway = path". Add a new tag with the "+" button, if the trail doesn't already have an "mtb:scale" tag. Type or choose mtb:scale from the dropdown menu. Then choose, as the tag's value, a number on the 0–6 scale describing how suitable the trail is for off-road riding. See guidance on the values here >.

  7. As well as the mtb:scale tag, the trail's width is especially valuable. It's given in metres, with a full stop as the decimal separator — so a trail 1.5 metres wide has the tag "width=1.5". Adding the tag works as described in point 6 above.

The iD editor's description of a map element on the left-hand side of the map, when it has just been drawn on the map or when an existing element on the map has been selected with the mouseThe iD editor's description of a map element on the left-hand side of the map, when it has just been drawn on the map or when an existing element on the map has been selected with the mouse

Edit a trail, e.g. by splitting it into parts so you can give the parts different tags

  1. Sometimes you need to edit a trail that's already been drawn. The most common need is to split a long trail into parts, so you can mark the parts with different mtb:scale tags according to the varying technicality, or give a wet section a surface=mud tag, for instance.
  2. First select the trail you want to edit with the left mouse button. The selected trail's line gets thicker, it starts to "pulse" and its points (nodes) become visible.
  3. Now select a suitable point with the left mouse button, and once it's selected (it's "pulsing"), the right mouse button brings up a menu where the scissors let you cut the trail at this point: the trail splits into two parts that are still attached to each other so that routing works, but both parts can be given tags separately.
  4. Select one of the two halves of the trail with the left mouse button so you can edit its tags.
  5. Sometimes more complicated edits are needed at trail junctions: one of the crossing trails gets split into parts, but the other is left whole. For these, select the point first, and then, holding down the SHIFT key, select one of the trails, after which the right mouse button brings up a different menu with all sorts of ways to edit the selected trail and the point as part of it. The easiest way to learn the different options is just to try them and use the editor's "Undo" button in the top right corner to roll back the changes you've made, so you can try new approaches. None of the changes goes into the OSM database until you save your additions and changes following the instructions below, so experimenting is completely safe as long as you don't save.

A trail junction selected, with the menu opened with the right mouse button for editing the trails' shared point.A trail junction selected, with the menu opened with the right mouse button for editing the trails' shared point.

Save the additions and changes you've made:

  1. Once you've added all the trails and tags or made your edits, you still need to save your changes to OSM: choose "Save" at the top middle of the map, and then fill in the "Changeset comment" field on the left-hand side of the screen with a short description of the changes or additions you've made.
  2. Check once more, on the left-hand side under the XXX Changes heading, all the additions and changes you've made that you're about to save.
  3. After checking, press the "Upload" button a little below the comment field, and your changes are saved to the OSM database.
  4. Note that OSM map data reaches many apps, including the Trailmap web app, with a delay: those apps fetch an update from the OSM database every night, so the previous day's edits and additions show on the map from the next morning onwards.

The Save button in the top right corner of the map also shows how many separate additions or changes you've made. The Undo button, in turn, lets you undo the additions and changes you've made — especially useful when you're practising using the editorThe Save button in the top right corner of the map also shows how many separate additions or changes you've made. The Undo button, in turn, lets you undo the additions and changes you've made — especially useful when you're practising using the editor

Once you've pressed the Save button, now is the moment when it's worth taking a moment to consider and check that the list under "Changes" really does contain the changes you want to save to the OSM databaseOnce you've pressed the Save button, now is the moment when it's worth taking a moment to consider and check that the list under "Changes" really does contain the changes you want to save to the OSM database

Congratulations! You've joined the community of OSM mappers, building the best possible trail map for other enthusiasts and everyone who gets out into nature.