When you use TripGo, you might occasionally find that our routing results suggest sub-optimal walking, cycling or driving paths; getting on or off public transport at the wrong stop, not walking along a path that you know is there or doing a turn on a road even though it’s prohibited. In many cases this is caused by gaps in our road and footpath data. You can help improve these results – thanks to the fantastic community effort OpenStreetMap (OSM).
What is OpenStreetMap?
OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.
Everyone can modify it and everyone can use it. We use it as the basis for our routing along roads and foot paths. Since it’s all one big global database, if you modify it ,not only will you see your fixes in TripGo but other users worldwide of many other apps will also benefit from your contribution.
A few simple steps
In the following we give a brief overview and a bunch of pointers for how to do that. The typical process looks like this:
- Open OSM and navigate to the area where you noticed a problem in the app.
- Set up an OSM account (if you don’t have one).
- Enter the “edit” mode and check if the road or path is there.
- If the road or path is missing, add it.
- Make sure that important properties are set on the path, such as what kind of road it is, what the speed limit – more details below.
- Save your changes and provide a message what you’ve fixed up.
- That’s it. Your changes should be reflected in TripGo within about two weeks. (If it’s something you consider urgent, let us know and we’ll give it a higher priority.)
Let’s start with a brief discourse into how OSM is structured so that you are editing the right thing. The main concepts are points (e.g., a restaurant), lines (e.g., a road, footpath or railway track), areas (e.g., the outline of a park or a beach) andrelationships (e.g., you are not allowed to make a right-turn from one road to another). When it comes to using OSM data for routing purposes, like we do, lines are the most important piece with relationships as a distant second.
Editing with routing in mind
Let’s have a closer look at lines. A line is modelled as a sequence of waypoints (note that these are different from points which indicate a point of interest) and the lines are then drawn from one waypoint to the next. Multiple lines can share such a waypoint, which indicates that you can, say, switch from one road to another; multiple lines can also cross each other without sharing a waypoint which indicates an overpass. When you add a new road or extend a previous one, it is important to connect it properly to the other roads and paths around. Otherwise, if a routing engine encounters an unconnected line, it needs to make guesses if that line really is unconnected (say, if it’s a small island) or if the OSM data is incomplete or erroneous and artifical connections need to be inserted. In our experience with crunching a lot of OSM data, we found that, unfortunately, the latter is usually the case, so please take care when you adjust the map and check that roads and paths are connected the right way.
Lines can stand for many different things such as roads, power lines, foot paths and cliff edges. A routing engine needs to interpret those correctly, as we don’t want to suggest walking along a railway track. So it is important to give lines the right type. If you mark a line as a road, you can also select the correct type of road, which will impact the estimated driving speeds along the road, whether parking is allowed along the road and which vehicles are allowed to us it. OSM also allows you to fine-tune the properties (tags) of a line. Most notably you can mark one-way roads as such and specifically say which mode of transport has access to it (including horses, but TripGo does not yet support this option). Lastly, name the road so that we can refer to it by its name rather than its coordinates.
When you draw a line you typically add waypoints one by one manually. Note that if you continue on at the end of an existing way, your line will be an extension to the previous one and take along all the properties of that line; so if you want to add a footpath that extends a road, it’s better to start somewhere in the void and then work towards to road. Alternatively, you can afterwards split the line at a waypoint and assign each part the right type and properties. Each click adds a new waypoint and when you’re done, just click again on your last waypoint or press “ESC”.
When you are happy and done with your changes, do not forget to save and provide a short commit message describing the changes you have made. This will be helpful if someone decided to review your changes later on. Once your changes are saved, they will be visible to other users of OpenStreetMap almost immediately and they will flow through to TripGo.
Editing OSM is quite easy using the editors that are linked from the OSM website itself. We suggest the iD editor from Mapbox, as it’s both easy to use and it comes with a quick tutorial. It works very well for most cases but it has a fairly limited feature set.
For offline use and detailed editing, JOSM is a useful tool even though it has a steeper learning curve. There are a bunch of tutorials available and it has a variety of plug-ins available – the turn restrictions editor in particular deserves a shoutout as it’s an important capability to identify restrictions such as no-right turns which is not available in iD at the time of this writing.
If you’re a developer and want to use OSM in your app, here are some useful resources to look at:
- Geocoding services: both Nominatim and GeoNames are built on OSM data and provide services for turning search terms into coordinates. Nominatim also does the reverse. This is where points of interest and naming of lines become very important.
- Routing services: there’s the Open Source Routing Machine, which provides fast routing on large-scale network, CloudMade’s routing API, and there are a lot more. and if you’re interested in connecting to our own multi-modal routing engine, drop us a line.
We hope this cleared a few things up and you are excited to contribute to OpenStreetMap as much as we are.