OpenStreetMap logo OpenStreetMap

One of the most important uses of the map during car navigation is to find the correct exit off a motorway to get to a destination. Missing an exit can be quite costly in terms of the time and fuel wasted in a much longer route than desired. In OSM, the tags that help to map this information are https://wiki.openstreetmap.org/wiki/Tag:highway=motorway_junction(exit number) and destination(destination sign).

The Mapbox data team has updated over 247 motorway exits and 1285 destination sign information in United States & Canada in the last year. Here’s the workflow we followed to create tasks on the Mapbox Tasking manager if you would like to create a community project for your own area. This workflow creates convenient tasks that can be distributed to review the data on individual highway routes on checkautopista2 for a particular area of interest.

screenshot 2016-11-14 13 12 21

1. Defining the area of interest:

Draw a boundary for the area of interest you want to cover in JOSM tagging as https://wiki.openstreetmap.org/wiki/Tag:area=yes and save it as .osm file.

2. Converting .osm to .json:

Using osmtogeojson we can convert .osm file to geojson.

3. Now we should get the city boundary polybox coordinates:

Use polybox to convert the geojson of the area of interest into a polybox format.

4. Extracting the highway routes in the area of interest:

For the exit numbers and destinations task, we wanted the highway routes inside the area of interest along with the relations. So, we use overpass query giving the polybox coordinates for getting the data and exporting it into geojson.

5. Filter out https://wiki.openstreetmap.org/wiki/Tag:highway=motorway along with relations:

Using this repository we can filter out features with highway=motorway, flattens relations, merges ways with the same relation and adds a buffer around them (so that they show up in tasking manager). Bus route (route=bus) are ignored.

Example of highway with relation: relation/11037

6. Merging multiple geojson to single geojson:

Incase if we want to do it for various areas of interest, we need to combine multiple AOI’s geojson’s to single geojson using geojson-stream-merge.

The final single geojson is then imported into tasking manager. In the tasking manager instructions give a link to checkautopista2 and use the format http://k1wiosm.github.io/checkautopista2/?id={rel} because it takes the rel property in the geojson and displays the ways in the tasking manager.

Hope my workflow will help you in creating the tasks effectively. Let me know if there is any other simpler way of doing this procedure.

Happy Mapping!

Email icon Bluesky Icon Facebook Icon LinkedIn Icon Mastodon Icon Telegram Icon X Icon

Discussion

Log in to leave a comment