Is it possible to prevent road segments being used when these are blocked by bollards, concrete blocks or the like?

I have one example where there the road Solhøjvej is blocked with a so called concrete block as you can see here


Here is a photo of the "block":


I’m exporting the Openstreetmap to PostgreSQL using osm2po and performs routing, but this does not know of these concrete blocks or bollards or stuff blocking the road.

I’m aware that this is perhaps not a simple task, to detect and split road segments when such obstacles occur, but that would be very useful. Am I just missing an option?

1 Answer 1


Yes, it's possible. But osm2po only takes barrier=bollard into account by default. If you need other types of barriers you'll have to use Java in order to override DefaultNodeTagResolver.isBarrier(). For pgRouting this information can be retrieved from the Vertex-Table which is not written by default, but can be activated by setting postp.1.class=de.cm.osm2po.plugins.PgVertexWriter in the config. Once created look for clazz < 0 in the table. Additionally setting sth. like nodeClazz.-128.name=Barriers in the config or on the commandline visualizes them in the WebTestUI (see below)

In osm2po barriers are handled like turn restrictions and must be explicitly activated by setting graph.support.barriers=true.

bollard-barries in Hamburg

  • Very exciting, I'm having a look at it now :) I'll get back. Commented Apr 5, 2013 at 9:56
  • 1
    Fantastic, I got it working. Now I both load bollards and concrete blocks. I did as you said and implemented my own nodetagresolver and it is working like a charm. Thank you for your help, this is VERY usefull! Commented Apr 5, 2013 at 11:20
  • @Carsten Can you please look at this question about osm2po ?gis.stackexchange.com/questions/293208/… thanks Commented Aug 18, 2018 at 3:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.