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
http://www.openstreetmap.org/?lat=57.010248&lon=9.936238&zoom=18&layers=M
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?
Answer
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
.
No comments:
Post a Comment