How to improve OSM road data with Mapillary
Posted by NunoCaldeira on 25 April 2017 in English (English).After seeing the diary of how to use Mapillary to add building attributes on The state of San Francisco buildingsi decided to create this article on how to use Mapillary as a tool to improve OSM road data. This article will focus on how to use Mapillary traffic sign detection to implement turn restrictions, Mapillary imagery to add lane value and turning lanes. I won’t get into how to capture Mapillary images using smartphone or action cams, as you can find that information on Mapillary website check here and you can request a car or bike mount for your smartphone here
(Please note that from my experience, after uploading the photos to Mapillary, the traffic sign detection can take from 24 to 96 hours to be processed and being displayed on the map).
Editor used JOSM. JOSM plugins needed: Mapillary; RoadSigns; Turnlanes-tagging; Turnrestrictions.
Open JOSM, go to EDIT and then pick PREFERENCES. Once in the options, head to the PLUG-INS menu and search and install these three plug-ins:
Mapillary (for being able to use Mapillary imagery and “Mapillary object layer”);
RoadSigns (if you want to add the traffic signs to OSM);
Turnlanes-tagging (for being able to add turning lanes);
Turnrestrictions (to create turn restrictions on intersections).
To make a thematic editing easier, head to VIEW/Map Painting Style and select Map Paint Preferences. Scroll until you find “lane and road attributes” by Martin Vonwald, select it and send it to the right using the arrow and then click ok.
Head back to VIEW/Map Painting Style and select LANE AND ROAD ATTRIBUTES, using this layer will be easier to check the current attributes on the OSM data (notice the number of lanes and lanes direction being displayed).
Pick a location with Mapillary photos that you or others have gathered.
Go to IMAGERY and select:
Mapillary and Mapillary object layer (the traffic signs will be shown on the map and the green dots are the Mapillary photos, you can turn off the layer if its too much information for you to handle.
Mapillary object layer with the detected traffic signs:
## Case 1:
Adding turn restrictions
In this intersection it’s mandatory to go straight (notice that the there’s a traffic sign on the Mapillary photo layer, which means that a traffic sign was detected in that photo, if you pick that photo on the map (turns it into orange), the photo will be displayed and you can see the sign in the photo.
Lets add the turn restriction to the OSM data (notice, make sure to split the lines in every intersection or when there’s different attributes):
First select the “from” line and then press CONTROL key on your keyboard and select the “to” line.
On the TURNRESTRICTION, click on “create a new turn restriction”, a menu will pop up with the road names. In this case pick “Straight Only” and click ok.
Turn off both Mapillary layers and notice a Straight Only sign appears on the Data Layer. Submit the changes to OSM.
Case 2:
Adding speed limits and bumps
Notice the traffic sign with the speed limit of 40 that was detected on the Mapillary object layer.
Lets pick create a node in that line and move the node to where the traffic sign is located and press “P” to split the line.
On our right pick “+add” on the tag and enter the “maxspeed” and its value.
Add a bump. Check the detected bump sign by Mapillary.
Create a node in the line where the bump is (notice, bump signs are located 50 meters or less before the actual bump, so make sure to click on “next picture” on the Mapillary photo preview, until you visualize the actual bump).
Go to the menu and go through PRESETS/HIGHWAYS/WAYPOINTS/TRAFFIC CALMING and pick BUMP
The bump has been added, submit changeset to OSM.
Case 3:
Adding turning lanes
Notice the lane turn restrictions detected by Mapillary (left one is mandatory to go left and the right lane turn left or go straight).
Let’s use the Turnlanes plug-in to add the data to OSM.
First select the line, then ALT+SHIFT+2 the plug-in menu will pop up. Add the number of lanes, in this case 2, and the mandatory turning lanes (left lane goes left, right lane goes left or straight)
Click ok. Notice how useful the “lane and road attributes” by Martin Vonwald is to visually display the data you just added. Submit changeset to OSM.
Case 4:
Adding traffic signs
Give way sign detected by Mapillary
Create a node in the line, select it, go to PRESENTS/TRAFFIC SIGNS/pick the sign
Menu will pop up, asking the location of the sign and in which direction does it apply.
Apply and notice the traffic sign is now added (you can clearly spot it as it has a white background, which does not occur with the Mapillary object layer that is transparent).
Case 5:
Adding sidewalk information:
By navigating through Mapillary imagery you can add the sidewalk attributes.
Notice on the Mapillary photo that after the intersection, there’s only sidewalk on the right side of the way.
Select the line before the intersection and add the a tag with “sidewalk:both”. Select the line after the intersection and add the tag “sidewalk:right”
As you can see with the “lane and road attributes” paint style you are now able to see the sidewalks attributes.
By implementing this workflow, we can assure high quality road data on OSM and the best data for routing.
I advise you if you have a strong local community of mappers to have a similar approach as Chetan did and use a OSM Task Manager to better organize: Collecting Mapillary photos; Adding the data to OSM; Validating.
Similar approach can be used to add street names, house numbers, fire hydrants or POI (like stores, bars, etcetera) if you capture photos on Mapillary with the smartphone pointed to the sideways instead of forward.
If you use OSMand, I recommend you to check how to add Mapillary overlay, so you can calculate your route to capture new sequences of streets that aren’t on Mapillary
Hope it helps, capture photos with Mapillary and improve OSM with them.
Happy mapping
Comment from PlaneMad on 28 April 2017 at 14:43
This is super detailed and useful. Thanks for writing this!
If there are too many Mapillary images in your area, the JOSM plugin could take quite a bit of memory and could get difficult to work with. At the Mapbox data team, we built a simple web ap to browse detected turn restrictions from Mapillary to make the process more efficient. We usedthis workflow to add many missing turn restrictions in Germany.
Comment from ElliottPlack on 3 May 2017 at 15:46
Thanks for writing this Nuno!
Comment from majkaz on 10 May 2017 at 13:39
The Mappilary plugin is a useful tool - but beware, in some places the road sign detection is mostly wrong, there are too many false positives detected or some signs are recognized wrong, showing a different one then there is on the ground.
Unless something happened lately, there is no way just yet to correct it in Mappilary itself and the downloaded photos overlay the wrong sign in the picture. I am not sure if there is a way to see the unprocessed image in JOSM. This means you cannot see the correct sign hidden under the falsely recognized one.
Comment from NunoCaldeira on 10 May 2017 at 18:45
@majkaz can you pinpoint me a area where “the road sign detection is mostly wrong”? I would say its accurate 8 out of 10.
As far as im aware the traffic sign correctly will be available soon.
You can “enable” and “disable” the traffic sign overlay in photo by:
1 - go to WINDOWS and pick IMAGE INFO
2 - The image info will be displayed on the right
3 - disable the traffic signs overlay in photo unchecking “SHOW DETECTIONS ON TOP OF IMAGE”
You can also apply filters by enabling the windows as in step 1 and then applying the select dates you wish or not older than one year.
hope it helps.