Opened 11 years ago

Closed 10 years ago

#949 closed defect/bug (fixed)

Maptool does not handle OSM access flags correctly

Reported by: wkcooper Owned by: KaZeR
Priority: major Milestone:
Component: tools Version: git master
Severity: Keywords:


Short description: Setting highway attributes to access=no, transport_mode=yes (e.g bus=yes) results in no access to the route.

Long Description: Using the OSM guidelines for defining access on a highway ( Transport Mode Restrictions section) it appears the correct way to indicate a highway is for bus use only would be to define access=no, bus=yes. This should result with the path having access flag of AF_BUS, instead the result is no access at all 0x0. Maptool generates the correct access flags, if the path has every transport_mode set to no (foot=no,motorcycle=no...) and the required one set to yes (bus=yes).

Expected result: transport modes set to yes be honoured even if the path access has been set to no.

Navit has been trying to direct me to drive on bus only highways because of this flag problem. So it might be affecting others without them recognising it by eliminating valid routes because all the flags are set to no access.

Attachments (2)

osm.c.patch (424 bytes) - added by wkcooper 11 years ago.
OSRM same wrong routing.png (146.6 KB) - added by usul 10 years ago.
OSRM wrong routing in St. Joseph

Download all attachments as: .zip

Change History (8)

Changed 11 years ago by wkcooper

comment:1 Changed 11 years ago by wkcooper

I've attached a patch to osm.c that changes the behaviour of the flag attribute. With this patch changing general access of a highway to no, while setting a transport mode to yes (e.g. bus=yes), will not result in all access flags to the highway being set to no. Reference

comment:2 Changed 10 years ago by usul

  • Resolution set to Incomplete/Missing infos
  • Status changed from new to closed

Was this issue solved?

comment:3 Changed 10 years ago by wkcooper

  • Resolution Incomplete/Missing infos deleted
  • Status changed from closed to reopened
  • Summary changed from Maptool does not handle OSM access flags not correctly to Maptool does not handle OSM access flags correctly


The issue has not been resolved. I have tested Navit with a map downloaded this week on the 25th and with Navit version 0.5.0 5538.

The issue is as follows -

The OSM wiki has an example highway tagged access=yes, foot=no, which means that all forms of traffic are allowed except foot traffic.

There is a on my daily commute highway tagged access=no, bus=yes, psv=designated, motor_vehicle=official. Based on the OSM example this highway should not be accessed to any traffic except bus, psv and motor_vehicle_official. Instead Navit routes me on to this highway, the highways flags are 0x1ff80040 (af_speed_limit|af_dangerous_goods|af_emergency_vehicles|af_transport_truck...)

I tracked the problem to the way maptool processes the access flags and my patch corrects the behaviour so that access is removed when access=no and then granted only to the tags that imply access is allowed.

My test is going from 10.6533172, -61.4140428 to 10.650911, -61.418676. Navit should never route me on the Priority Bus Route, that is the highway with the access tags mentioned above.

I hope this clears up the situation


Last edited 10 years ago by wkcooper (previous) (diff)

Changed 10 years ago by usul

OSRM wrong routing in St. Joseph

comment:4 Changed 10 years ago by usul

Thanks for reopening the ticket and giving us support even in presence :)

When I analyse your example right, it's about this area in St. Joseph (Trinidad). If we look in the south, there is the red 'priority bus route' that is way #131359367 currently and tagged as you describe.

But for this special example, I would expect that this is a tagging problem (too). IMHO the wiki says, that the *=official attribute is used when the vehicles are explicitly allowed and not that only official vehicles are allowed.Even does the same (as you say wrong) routing: see this screenshot:
OSRM wrong routing in St. Joseph

The situation you describe, I would modell as follows:


From my understanding (crosschecked with DE:Access, too) this should be right.

But maybe you are right and Navit uses really wrong computation (sorry I'm not that deep into the code), can you provide us another example where it missdetects any access roles? I will take a look at my area, to find some bad behaviour, too.

comment:5 Changed 10 years ago by wkcooper

Thanks for the response. I never checked the routing against . Good find. Maybe that road is incorrectly tagged.

What I did to test the situation when I reported the bug was to create a test road network using JOSM, then convert my test network to a map file using maptool and then test the route that Navit would create with different tags on the road. That way I could create any road tag quickly with

I will go through this again and upload the test osm files, Navit map files and screenshots of Navit's route if I get the same wrong paths I got before. If not I will close the ticket.

Hopefully I will complete that today.

comment:6 Changed 10 years ago by wkcooper

  • Resolution set to fixed
  • Status changed from reopened to closed


I have checked using the test methodology I used when first reporting the bug and have not been able to recreate the problem. Looking at the SVN logs it appears the bug was fixed by revision 5407 by mdankov, Sun Mar 3 06:54:09 2013 UTC which among other things allowed access rights to be overridden.

The fix was hidden by the incorrect tags placed on the highway, I will fix the tags and close this ticket.

Thanks for the assistance.

Note: See TracTickets for help on using tickets.